I think this is mostly directed at David, but if anyone has answers, I'd welcome them.
In your command pattern implementation or somewhere on this thread (can't remember where I saw it) you mention that GWT doesn't properly implement parameterized method calls on the RPC service. Is that true, or did I misunderstand something? I think you also mentioned that that is in fact desirable, since you would want one service per procedure call. Can you explain that a little more? I'm not sure I understood. Oh, and I updated my annotation to take a Class<?> rather than a String literal, thanks for the tip. On Jul 6, 9:06 am, jdwy <[email protected]> wrote: > Thought I'd point to my command pattern > examples:http://github.com/jdwyah/tocollege.net/tree/f97ed4ff3f31c1c463eb426c3... > > I found the command pattern to be just the ticket to deal with XSRF > attacks. In the directory above you can see my AbstractCommand class > and a number of Command subclasses. I ended up creating a > CommandService class as well, which would have different affects on > the client and server (basically it would persist entities when on the > server and just execute logic when on the client). > > Cheers, > -Jeff > > On Jul 6, 6:17 am, martinhansen <[email protected]> > wrote: > > > Grrrrrrrrr! > > > I found out why! Grrrrrrrrr! > > > The Action and Response classes must have an empty default constructor > > to be serializable. I've had this error before. Unfortunately, the GWT > > compiler error message is anything but helpful in this case. Grrrr. > > > On 6 Jul., 11:57, martinhansen <[email protected]> wrote: > > > > Hello Herme, > > > > your example is very interesting. I downloaded it and changed it to > > > work with GWT. But I was not successful. When I run my application, > > > the compiler complains about my client service interface: > > > > [ERROR] Type 'com.isp.gwtpattern.client.rpc.Response' was not > > > serializable and has no concrete serializable subtypes > > > > The code is as follows: > > > > @RemoteServiceRelativePath( "buchungServlet" ) > > > public interface BuchungService extends RemoteService { > > > > <T extends Response> T execute(Action<T> action); > > > > } > > > > What am I doing wrong here? My interfaces "Action" and "Response" both > > > implement IsSerializable. > > > > M > > > On 5 Jul., 11:55, hgarciag <[email protected]> wrote: > > > > > Martin, > > > > > For really simple example you can see here: > > > > >http://itsp.typepad.com/voip/2009/07/gwt-implementing-rpc-command-pat... > > > > > At the end, you will need to add some more code, but you can see how > > > > the pattern works (it helped me!) > > > > > Herme > > > > > On Jul 5, 10:16 am, martinhansen <[email protected]> > > > > wrote: > > > > > > Hello David, > > > > > > I've read your source code and your example. It is very interesting. > > > > > But although it's short and simple, I still don't understand it. > > > > > Especially "GIN" and "GUICE" confuses me a lot. Can I use your example > > > > > without these technologies? > > > > > > Does anyone know a really simple example? The example inRay'ssheet > > > > > is interesting and simple, but incomplete. Where does the actual > > > > > action take place in his example, let's say, querying some contact > > > > > details from a remote data base? I think this important part is > > > > > missing. > > > > > The ContactService defines a method called "execute", but where is > > > > > this method implemented? Is it implemented automatically by some > > > > > mechanism? If yes, how is it done? Is "execute" the only method in the > > > > > interface I ever need, e.g. some kind of place holder? > > > > > > Any help would be greatly appreciated. > > > > > > On 5 Jul., 08:17, David Peterson <[email protected]> wrote: > > > > > > > Hi Nathan, > > > > > > > On Jul 5, 2:15 am, Nathan Wells <[email protected]> wrote: > > > > > > > > I updated my project to only use the two interfaces as suggested > > > > > > > by > > > > > > > David. Instead of using actionhandlers and registering them, I > > > > > > > created > > > > > > > an annotation for the IRemoteProcedureCall implementations that > > > > > > > contains the canonical class name of the IProcedure that is to be > > > > > > > run > > > > > > > on the server. > > > > > > > As you say, one of the downsides of linking the handler to the > > > > > > concrete implementation is that there may be issues with the GWT > > > > > > compiler. That said, in general it seems to mostly ignore > > > > > > attributes, > > > > > > so it may not be an issue. > > > > > > > The other downside for me is that it ties the action interface to a > > > > > > specific implementation. This makes it more difficult to write mocks > > > > > > for tests, etc. Having them configured purely on the server-side > > > > > > means > > > > > > you can replace them with whatever you like on in test scenarios. > > > > > > Or, > > > > > > if you want to provide alternate implementations (eg. JDO vs > > > > > > Hibernate), you can have both in your app and just switch between > > > > > > them > > > > > > by changing your DI configuration. > > > > > > > The downside of my method is that you may forget to actually > > > > > > implement > > > > > > the handler. Of course, this will generally show up pretty quickly > > > > > > when you try to actually use it. And I guess it's still quite easy > > > > > > to > > > > > > forget to supply the annotation anyway... > > > > > > > David --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
