On Thu, Dec 18, 2008 at 11:25:49AM +0000, Ben Smith wrote: > org.apache.shindig.social.core.model.PersonImpl is the default > implementation of the Person interface. If you develop your own > implementation then you would bind it like: > > this.bind(Person.class).to(PersonDb.class).in(Scopes.SINGLETON);
Woah, no! The bind().to() part is ok, but you don't want Person as a singleton. That would mean there's a single Person object in the whole application, which is clearly-not-rightâ„¢. As a matter of fact, if your PersonService creates its Person instances "by hand" from whatever backend store you have, there's no real need to actually bind them with Guice. Binding is only required for the case where new empty Persons are going to be injected somewhere.

