Huh, I have done this with a command pattern style... bind(ServiceCached.*class*).in(Singleton.*class*); As simple as that ! I use XML between client and server. Action class know what is the url to use and when a response is received, I have a class that transform my XML in object.
Works fine, I have to rework the cache a little because for now I use a static array. Here's some meat : http://pastie.org/598748 I have to change my XMLObjectBuilder for a static one, since I don't really need to have more than one instance of it. If I had passed more than one object In my xml file, I simple have to call the same class, with a diffrent object, to build the object. Hope you'll find that interresting Christian On Sat, Aug 29, 2009 at 4:36 AM, Jeff Chimene <jchim...@gmail.com> wrote: > > It looks like that's the only way. > > One wrinkle that was not mentioned in the original post is that the > URL argument to a RequestBuilder instantiation is RESTful with > volatile path components. IOW, instance bindings will not solve this > problem. > > I'm using binding annotations: > > > bind(RequestBuilder.class).annotatedWith(XXX.class).toProvider(XXXRequesterAsync.class); > > bind(RequestBuilder.class).annotatedWith(YYY.class).toProvider(YYYRequesterAsync.class); > > I'm using the provider binding because I want only one instance of > each implementing class. > > The XXXRequesterClass knows what CGI method and URL to use when > instantiating a RequestBuilder object. The volatile URL path > components are concatenated at runtime. > > Each annotation class (XXX.class, YYY.class) is an interface. > > Discuss amongst yourselves. > > On Fri, Aug 28, 2009 at 6:02 PM, Jeff Chimene<jchim...@gmail.com> wrote: > > On 08/28/2009 05:53 PM, Jeff Chimene wrote: > >> Hi, > >> > >> I'm not enough of a Java pundit to understand how to implement a > >> RequestBuilder using Gin. > >> > >> The issue is that one cannot instantiate a RequestBuilder class w/o a > >> HTTP method and a URL. > >> > >> How does one pass these parameters in such a situation? > > > > I thought about using BindingAnnotations. I'm hoping there is Another > Way. > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-toolkit@googlegroups.com To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~----------~----~----~----~------~----~------~--~---