On Thu, Jul 10, 2008 at 8:33 AM, Paul Lindner <[EMAIL PROTECTED]> wrote:
> I'd appreciate it if someone could look at SHINDIG-440 and validate the > changes there.. If we go ahead with the patch there we'll also want to > document the list of bindings that can be customized, perhaps with a sample > Guice module.. My main issue with ImplementedBy is that it makes it's fairly "magical" for users. I'd rather go with an overrideModule solution to the problem. > > > > On Jul 9, 2008, at 3:47 PM, Kevin Brown wrote: > > On Wed, Jul 9, 2008 at 3:30 PM, Paul Lindner <[EMAIL PROTECTED]> wrote: >> >> Hi, >>> >>> I spent the past few days really learning the ins and outs of Guice. >>> It's >>> starting to make a lot of sense. >>> >>> However, one area that is difficult is overriding the implementation >>> classes. Guice only allows you to override entire modules. If you only >>> want to override only one or two bindings this becomes quite tedious. >>> Right >>> now we have: >>> >>> CommonGuiceModule - binds SecurityTokenDecoder >>> DefaultGuiceModule - binds 15 interfaces >>> HttpGuiceModule - binds 4 interfaces >>> DefaultModelGuiceModule - binds 11 interfaces >>> SocialApiGuiceModule - binds 11 interfaces >>> >>> Now, right now I only want to implement my own interfaces for: >>> >>> PeopleService >>> PersonService >>> OpenSocialDataHandler >>> SecurityTokenDecoder >>> ActivitiesService >>> HttpFetcher >>> DataService >>> Person >>> >>> This requires a new CommonGuiceModule, DefaultGuiceModule, >>> DefaultModelGuiceModule, SocialApiGuiceModule and a whole bunch of >>> cut-and-paste code. >>> >>> Is there anyway to make this easier? Splitting things up into smaller >>> modules doesn't seem productive. Perhaps we could use @ImplementedBy >>> pointing at the defaults shindig implementation classes? >>> >> >> >> Yes -- if you link in the latest Guice code (NOT on maven repo, >> unfortunately), you can override bindings (See Guice.overrideModule). >> >> We use this internally at Google, and it works pretty well. >> >> >> >>> >>> >>> Paul Lindner >>> [EMAIL PROTECTED] >>> >>> >>> >>> >>> > Paul Lindner > [EMAIL PROTECTED] > > > >

