Hi Massimo,

On 5/19/05, Massimo Lusetti <[EMAIL PROTECTED]> wrote:
> Anyway, my apps have to work this way:
> Data comes in with some kind of events, JMS test/xml messages, then
> data is going to be parsed and processed by the main dispatch class
> which read a portion of the message and decide where to forward the
> rest of the data (payload), here is where I've to decide which service
> and also which implementation of that service to use.
> Let's say data should be delivered firstly based on the type of data
> which let me choose the service then to choose the implementation to
> use i look at the provider/producer of the data itself, all this
> information are wrapped inside a portion of the jms message.
> I could say that: every type of data i could receive needs an hivemind
> service and every producer of that data i want to support needs an
> implementation of that service.
> 

As I understand it something like the StrategyFactory would be most
appropriate here as you for any incoming message only ever want to
invoke one of the 400 services; all based on the contents of the
message itself. Unfortunately you won't be able to use the
StrategyFactory as it is because it does its dispatching based on the
*type* of the first service method parameter only. In your case you
need to do the dispatching based on the *value* of the service method
parameter.

I think you're probably best of if you implement the dispatcher
services manually (without using StrategyFactory) as regular HiveMind
services. With the dispatcher service you can register the
"destination services" of the dispatch using a HiveMind configuration.

With a two level dispatch you'd end up with one top-level dispatcher
service dispatching to the 10 other dispatcher services. These would
in turn dispatch to any of the 40 implementations. Depending on
whether you need lifecycle support, a service model, and / or
autowiring for the implementations you might not even need to define
these as services, just POJOs.

> Thanks very much for your time, you were more then helpful!
> 

Glad I could help!

--knut

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to