Thought I'd point to my command pattern examples:
http://github.com/jdwyah/tocollege.net/tree/f97ed4ff3f31c1c463eb426c34a55de439c601b3/src/main/java/com/apress/progwt/client/domain/commands

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 <martin.hanse...@googlemail.com>
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 <martin.hanse...@googlemail.com> 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 <hgarc...@gmail.com> 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 <martin.hanse...@googlemail.com>
> > > 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 <da...@randombits.org> wrote:
>
> > > > > Hi Nathan,
>
> > > > > On Jul 5, 2:15 am, Nathan Wells <nwwe...@gmail.com> 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 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to