Sure, it is a very reasonable thing to do.

Some notes though,

Lazy instantiation would be good, particularly if you have many  
services that won't necessarily be used in a particular service.

And I put the singleton into the xxxServiceAsync interface rather than  
the xxxService interface. This is actually just a little nit of mine,  
and probably makes very little difference in the long run. But, the  
reasoning behind that is, the xxxService interface must be compiled to  
bytecode as it is used by the xxxServiceImpl servlet, whereas the  
xxxServiceAsync doesn't. So, by placing the service singleton in the  
async interface, you aren't mixing client-only code with client-server  
code.

-jason

On Sep 30, 2008, at 3:02 AM, hezjing wrote:

> Hi
>
> I have many service creation (like the following code) in my GWT  
> application,
>
> XxxxServiceAsync xxxxService = GWT.create(XxxxrService.class);
>
>
> Is it safe to make all XxxxServiceAsync a singleton?
>
>
> Thank you!
>
>
> -- 
>
> Hez
>
> >


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to