On Tue, Jun 23, 2009 at 12:55 PM, Paul Lindner <lind...@inuus.com> wrote:

> On Tue, Jun 23, 2009 at 10:47 AM, Kevin Brown <e...@google.com> wrote:
>
> > On Tue, Jun 23, 2009 at 10:21 AM, Paul Lindner <plind...@linkedin.com
> > >wrote:
> >
> > > We now have Guice 2.0, nice things..
> > >
> > > http://code.google.com/p/google-guice/wiki/Guice20
> > > This allows some nice things like the following code snippet.  Does
> > anyone
> > > want to come up with what changes we'd like to see in the way shindig
> > uses
> > > Guice and especially how we interact with integrators...
> >
> >
> > multibindings and provider methods would improve a lot of things.
> >
> > For the case below, multibindings would be much better -- different
> modules
> > could contribute their own handlers.
> >
>
>
> That sounds like a good thing.  Anything that makes it easier for
> implementors is fine by me.
>
> What do people thing about using guice-servlet?


I like it, though in order to use their servlet injection model we'll need
to restructure some of our modules. Not a big deal, but it's work to be
done.

I do worry about veering into the realm of depending too much on guice for
this though. We don't want to wind up in a situation where you have to use
guice to use the servlets if we can avoid it.


>
>
> Also, I'd be interested in seeing the Guice graph for shindig.  Anyone up
> for that?
>
>
> >
> >
> > >
> > >
> > >
> > > @@ -66,14 +68,17 @@ public class SocialApiTestsGuiceModule extends
> > > AbstractModule {
> > >
> > >
> > >
> >
> bind(BeanConverter.class).annotatedWith(Names.named("shindig.bean.converter.json")).to(
> > >         BeanJsonConverter.class);
> > >
> > > -    bind(new TypeLiteral<Set<Object>>(){}).annotatedWith(
> > > -        Names.named("org.apache.shindig.social.handlers"))
> > > -        .toInstance(ImmutableSet.<Object>of(ActivityHandler.class,
> > > AppDataHandler.class,
> > > -            PersonHandler.class, MessageHandler.class));
> > > -
> > >     bind(String.class).annotatedWith(
> > >         Names.named("shindig.containers.default"))
> > >         .toInstance("res://containers/default/container.js");
> > >     bind(ContainerConfig.class).to(JsonContainerConfig.class);
> > >   }
> > > +
> > > +  @Provides
> > > +  @Singleton
> > > +  @Named("org.apache.shindig.social.handlers")
> > > +  Set<Object> getHandlers() {
> > > +    return ImmutableSet.<Object>of(ActivityHandler.class,
> > > AppDataHandler.class, PersonHandler.class, MessageHandler.class);
> > > +  }
> > > +
> > >  }
> > >
> >
>

Reply via email to