Just a point:

If you use GWT1.5 with Java5 semantics, just do

@RemoteServiceRelativePath("myservice")
public interface MyService extends RemoteService {
...
}

when you code like this

private static MyServiceAsync = GWT.create(MyService.class);

It'll automatically point to '/myService' path, making the work of
servicedeftarget for you

Just a question about your code: are you the static block is executed
at the first time the class is used or when the class is loaded ( on
js code loaded on browser, I mean ) ?

Oskar


On 1 oct, 22:04, Matt Bishop <[EMAIL PROTECTED]> wrote:
> I have developed the following class for Service singletons.  It has
> three advantages:
>
> 1. Service class is not instantiated until the service needs to be
> used.
> 2. _instance is never checked for null, which isn't a necessary use of
> time during the life of the app.
> 3. The static init code is cleaned out by GWT after class init, so the
> code doesn't take up memory.
>
> The last two are minor, but in the "death by 1000 cuts" problem of RIA
> apps in JS, these are two less cuts.
>
>     static class App
>     {
>         private static LoaderServiceAsync _I =
> GWT.create(MyService.class);
>
>         static
>         {
>             String ep = GWT.getModuleBaseURL() + "MyService";
>             ((ServiceDefTarget) _I).setServiceEntryPoint(ep);
>         }
>
>         public static MyServiceAsync get()
>         {
>             return _I;
>         }
>     }
--~--~---------~--~----~------------~-------~--~----~
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