Hey folks,

I'm just getting started with Guice (and DI in general). I have a
question, hope it's not too dense.

I have a method that looks something like this in its first
incarnation (_predictors is a collection):

    public boolean dispatch()
    {
        for( PredictorProfile predictor : _predictors )
        {
            Thread handler = new DispatchHandler( predictor );
            handler.run();
        }
        return true;
    }

i.e. for each predictor that the object knows about, kick off a thread
to process it, and then return. (The return true is just a placeholder
for a proper status code later.)

Now I've started to think Guicily, I don't like the look of that call
to new. Everything else in this app so far is injected for me by
Guice.

What's the best pattern for this kind of situation?

Thanks!

Andrew.

--~--~---------~--~----~------------~-------~--~----~
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