Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Best practice to implement Command Pattern RPC on server?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Peterson  
View profile  
 More options Jul 3 2009, 10:55 am
From: David Peterson <da...@randombits.org>
Date: Fri, 3 Jul 2009 07:55:27 -0700 (PDT)
Local: Fri, Jul 3 2009 10:55 am
Subject: Re: Best practice to implement Command Pattern RPC on server?
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;


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google