Take a look at AssistedInject and MapBinder. There are a couple
examples posted here 
http://groups.google.com/group/google-guice/browse_thread/thread/3c86c7712deae803.
Maybe this will give you some ideas.

Cheers
Alen

On Dec 3, 2:31 pm, Lee <[email protected]> wrote:
> Hi, All
>
> I have an legancy application which use factory pattern to create
> different service depending on different service key,
>
> Here is the pseudo-code
>
> /**
>  * Create service handler
>  **/
> ServiceHandler handler = ServiceHandlerFactory.getInstance
> ().createServiceHandler(serviceId);
>
> /**
>  * execute.
>  **/
> handler.handle();
>
> Since all the services are implementing the same interface, is there a
> good suggestion that how i should do to refactor this into guice
> inject pattern?

--

You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.


Reply via email to