Hey ClusterCougar,

I think your implementation is over-complicated. On the client side,
just stick to two basic interfaces (and concrete implementations there-
of) - Action and Result (I'm using 'Result' rather than 'Response'
because that is often used in HTTP-related APIs), or in your API,
IProcedure and IReturn. The IAttributes, IRemoteProcedure and other
interfaces are unnecessary.

Then, on the server side, I've got 'ActionHandler' classes, which look
something like this:

public interface ActionHandler<A extends Action<R>, R extends Result>
{
   public Class<A> getActionType();

   public R execute( A action ) throws Exception;
}

You then register your various ActionHandler instances with your
'RPCService' and it just matches up the action passed in with the
appropriate action handler, calls execute and you're off to the races.

Sorry about the incomplete example - the code itself is tied up in the
app I'm using this in at the moment. I hope to make it a bit more
general down the track.

David

On Jun 30, 8:05 pm, ClusterCougar <nwwe...@gmail.com> wrote:
> I thought I posted this last night, but I don't see it. Apologies if
> this is a dupe.
>
> I've tried to implement the command pattern using generics, but have
> some hangups. You can see my code at
>
> http://code.google.com/p/gwt-command-pattern/
>
> Hangups:
>
> 1) Too many parameters. It's just not pretty
> 2) I have to parameterize the RPCServiceAsync at the class level,
> whereas I would like to parameterize at the method level. This is a
> constraint of the compiler.
> 3) All my server-side code actually resides on the client side,
> because of the aggressive nature of the GWT compiler. I would add my
> voice again asking for a simple annotation or annotations like
>
> on a class: @GWTIgnoreReference(ServerSideClass.class)
> and/or a method: @GWTIgnoreMethod
>
> I think there are many justifiable use cases for this type of thing,
> and I can't think of any way it would decrease user experience. Does
> anyone know if this is a planned feature? Any comments/suggestions on
> how to remediate the problems above that I don't know of? Ray Ryan,
> are you listening?
>
> Thanks,
>
> On Jun 25, 4:07 pm, Eric <erjab...@gmail.com> wrote:
>
> > On Jun 25, 5:12 pm, Herme Garcia <hgar...@peoplecall.com> wrote:
>
> > > Hi,
>
> > > After listening carefully Google IO's session from Ray Ryan about
> > > "Best PracticesFor Architecting Your GWT App" :
>
> > >http://code.google.com/intl/es-ES/events/io/sessions/GoogleWebToolkit...
>
> > > He suggests acommandpatternimplementation for RPC calling (see
> > > slides 21-25) they are using in Wave.
>
> > Ray,
>
> > If you're reading this, can you tell us if the full code for your
> > contact
> > manager is available anywhere?  Also, the second of the "Contact
> > DIsplay UI"
> > slides has the line
>
> >     currentContactId = currentContactId;
>
>
--~--~---------~--~----~------------~-------~--~----~
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