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. DispatchContext: A bag of objects needed for service execution, plus some utility methods.

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