Thank you Adrian, please see inline:

On Jul 20, 2012, at 9:33 AM, Adrian Crum wrote:

> This will be very helpful - thanks for starting it Jacopo!
> 
> I will start off with the obvious answers...
> 
> LocalDispatcher: The service dispatcher interface.
> GenericAbstractDispatcher/GenericDispatcher: LocalDispatcher implementations.
> ServiceDispatcher: A service dispatcher "engine". Basically, the 
> LocalDispatcher implementations delegate to it.

I guess that with "engine" you mean an "helper" class (or similar) and not a 
service engine (i.e. implementation of GenericEngine).
Apart from this, I see that the ServiceDispatcher is used in a lot of code 
directly... shouldn't we use instead the LocalDispatcher? According to your 
notes, if I understand them, the only class that should reference the 
ServiceDispatcher should be GenericDispatcher that is the only class that 
implement LocalDispatcher; but GenericDispatcher doesn't use at all the 
ServiceDispatcher.

My next doubt/question is about the GenericEngine interface: how it relates 
with LocalDispatcher and ServiceDispatcher?

> DispatchContext: A bag of objects needed for service execution, plus some 
> utility methods.

So, is the DispatchContext associated to the LocalDispatcher or instead it is 
an implementation detail that makes sense only for the ServiceDispatcher?

Thanks,

Jacopo

> 
> I agree there is a lot of feature envy between classes. The API could be 
> cleaned up a lot.
> 
> From my perspective, the GenericDispatcher.getLocalDispatcher method should 
> not exist - since it forces you to reference an implementation. Instead, 
> there should be a separate service dispatcher factory.
> 
> -Adrian
> 
> On 7/20/2012 7:33 AM, Jacopo Cappellato wrote:
>> Hi all,
>> 
>> I am a bit confused about the meaning/purpose/responsibilities of the 
>> following classes:
>> 
>> ServiceDispatcher/GenericDispatcher/LocalDispatcher/DispatchContext
>> 
>> Would any of you help me understand the role of each of these classes? They 
>> all see rather intermingled in terms of responsibilities.
>> For example, what is the purpose of creating two instances with different 
>> names of a dispatcher associated to the same delegator:
>> 
>> LocalDispatcher dispatcher = GenericDispatcher.getLocalDispatcher("entity-" 
>> + delegator.getDelegatorName(), delegator);
>> 
>> and
>> 
>> LocalDispatcher thisDispatcher = 
>> GenericDispatcher.getLocalDispatcher(delegator.getDelegatorName(), 
>> delegator);
>> 
>> ?
>> 
>> Thanks,
>> 
>> Jacopo
>> 
>> 
>> 
>> 
> 

Reply via email to