On Jan 27, 1:43 am, PhilBeaudoin <[email protected]> wrote: > Hi all, > > Gin has a great feature where it will GWT.create() an interface if it > is not explicitly bound. However, if you want the GWT.create() call to > occur just once then you need to bind the interface as a singleton. > Often it would be much simpler and cleaner to annotate the interface > with @Singleton instead. This would be relatively easy to support in > gin I believe, but unfortunately such scope annotations are not > permitted by Guice.
is there any reason to force the GWT-generated class to be a singleton? Since you're starting with an interface, GWT.create(MyInterface.class) cannot have any instance-specific customization. There's no way to apply any. So, two calls to GWT.create(MyInterface.class) would have to create equivalent instances. I would not be surprised if GWT.create just creates one global JavaScript instance for both. There's no reason for anything else. Respectfully, Eric Jablow -- 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.
