Sunday, May 30, 2010

Re: GWT.runAsync and Command Pattern

I had exactly the same issue and in the end abandoned the command
pattern. I managed to come up with an approach using standard RPC that
gave me most of the advantages i.e. centralized error handling,
session expiry and the ability to cancel all currently active calls.
Even using standard RPC You still need to be careful that your RPC
service classes don't get too big because as soon as the proxy is
created this will include all the dependencies for all classes
referenced as arguments via the service functions.

On May 30, 4:10 pm, Julio Faerman <jfaer...@gmail.com> wrote:
> Would it be possible to wrap / unwrap the request, removing the
> immediate inheritance or the compiler must generate the type
> serializers eagerly for all types ever reachable?
> Thanks for the advice on the interface, Frederico, i hope i can use
> it. In my case, code splitting is more important than commands, i wish
> they weren't mutually exclusive.
>
> On May 30, 11:17 am, federico <federico.mona...@gmail.com> wrote:
>
>
>
> > hi julio,
>
> > the issue you mentioned exists,
> > anyway your ActionService interface should be:
>
> > <T extends Response, V extends Request<T>> T execute(V req) throws
> > ActionFailedException;
>
> > on the other hands it's not possible at compile time to predict wich
> > results are connected with wich requests
>
> > On 30 Mag, 16:13, federico <federico.mona...@gmail.com> wrote:
>
> > > yes
> > > also i've faced this problem and didn't find any solution
> > > i'think the previous issue it's connected with this:
>
> > >http://code.google.com/p/google-web-toolkit/issues/detail?id=2374&can=5
>
> > > On 30 Mag, 15:48, Tristan <tristan.slomin...@gmail.com> wrote:
>
> > > > You might be running into this issue:
>
> > > >http://code.google.com/p/google-web-toolkit/issues/detail?id=4412
>
> > > > The compiler simply doesn't do enough analysis to do code split
> > > > properly when inheritance is involved, staring the issue may help.
>
> > > > Cheers
>
> > > > On May 30, 7:38 am, Julio Faerman <jfaer...@gmail.com> wrote:
>
> > > > > Hi,
>
> > > > > I am trying to split a GWT app that uses the command (action) pattern.
> > > > > The problem is that  "GWT.create(ActionService.class)" causes every
> > > > > subclass of the return and parameter types to be included in the
> > > > > initial fragment.
>
> > > > > For instance, my action interface is:
>
> > > > > public interface ActionService extends RemoteService {
> > > > >         <T extends Response, V extends Request> T execute(V req) throws
> > > > > ActionFailedException;
>
> > > > > }
>
> > > > > the problem is that "module1.SomeRequest" and "module2.OtherRequest"
> > > > > gets included in the initial fragment.
> > > > > Do you see a way around this?
>
> > > > > Thanks,
> > > > > Julio Faerman

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment