I think a bindAndExpose() would be good. I think that in almost each case you need the exposed object to be bound in the local modul as well. so I think bind(myObjet) expose(myObject) should just be replaced by bindAndExpose() and if possible without the @Expose tag (Still not sure why it's there)
By the way, what is the expose() method used for now when the @Expose tag has taken over the task completely ? My project was broken after I updated guice, I've got alot of "object already bound" messages (or something) because of the double @Expose and expose() on each exposed object. On 1 Dec., 01:59, Mikkel Petersen <[EMAIL PROTECTED]> wrote: > Oh, sorry, didnt see, you explained that in your first answer. > > On Dec 1, 1:58 am, Mikkel Petersen <[EMAIL PROTECTED]> wrote: > > > Ok, why do we have to do this, is it some kind of workaround because > > something better is not possible ? To me it's confusing and somehow > > don't mix in well with the original "bind()" method. I think ideally > > expose() should just work like bind(), so you can do things like expose > > (IPerson.class).toInstance(new Person()); > > On Dec 1, 1:38 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > Yeah, if your @Provides method has @Exposed, it gets exposed > > > automatically. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
