Another consideration is that setting timeouts etc. for requests on
the client is done at the service level using an instance of a
RpcRequestBuilder passed to the ServiceDefTarget. For instance,

NotificationServiceAsync notificationService =
(NotificationServiceAsync) GWT.create(NotificationService.class);
// Use the a new LonRpcRequestBuilder to set the timeout value for the
request and log timings.
((ServiceDefTarget) notificationService).setRpcRequestBuilder(new
LonRpcRequestBuilder(true));

If you're going to need different timeout values or other
configuration on a per remote call basis then you'll need to split up
the methods between services to get the configurability you need.

Take a look at Ray Ryan's presentation from Google I/O 2009 as well.
http://code.google.com/events/io/2009/sessions/GoogleWebToolkitBestPractices.html
It has some recommendations.

On Jan 12, 3:32 pm, dcy7 <[email protected]> wrote:
> Keep in mind you can easily OOP your code -- Service.java could load
> up multiple classes for different purposes, and pipe everything from
> client via your Impl & Async. Suppose it depends on the scope of your
> project really. Depending on the size of data throughput both ways, it
> could be better to use separate "Services" to avoid potential
> bottlenecks - we are in fact using Java... In the end, each service is
> compiled into respective javascript. Use your Impl to make the magic
> happen server side(processing, file io, etc) - I would personally
> avoid duplicate Service.java files, in respective nature and in code.
> Others may disagree ... once again, we are using Java...
>
> On Jan 12, 2:59 pm, Russ <[email protected]> wrote:
>
>
>
> > I have a single app that needs to call several different methods from
> > the server.
>
> > Is it better to have all the methods contained in one RPC service, or
> > should I have a speerate service for each method?
>
> > (By "Service" I mean the Service.java, ServiceAsync.java and
> > ServiceImpl.java files)
>
> > Thank you.
-- 
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.


Reply via email to