Hi Guys,

My Instantiation plugin was getting really slow because I was using
the default static final CONSTANT ... in each client classe for my
I18N translation strings

I have implemented a simgleton and my Instantiations plugin is a lot
faster. I guess Singleton does matter.

public class Locale {

        private static final AppConstants CONSTANTS = (AppConstants)
GWT.create(AppConstants.class);
        static Locale locale;

        public static AppConstants getCONSTANTS() {
                if (locale == null){
                        locale = new Locale();
                }
                return CONSTANTS;
        }

        private Locale(){

        }

}


- Erick

On Sep 24, 6:19 pm, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
> Yeah i like it better also!
>
> Xavier A. Mathews
> Student/Developer/Web-Master
> Client Based Tech Support
> Hazel Crest Illinois
> [EMAIL PROTECTED]
> "Fear of a name, only increases fear of the thing itself."
>
> On Wed, Sep 24, 2008 at 5:14 PM, Alex Rice <[EMAIL PROTECTED]> wrote:
>
> > Thanks, I like this technique.
>
> > On Sep 24, 3:46 pm, Reinier Zwitserloot <[EMAIL PROTECTED]> wrote:
> > > You can create the singleton inside the interface. e.g:
>
> > > public class MyImages implemens AbstractImageStoreThingie {
> > >     AbstractImagePrototype closeButton();
> > >     ... more AIPs.....
>
> > >     public static MyImages STORE =
> > > (MyImages)GWT.create(MyImages.class);
>
> > > }
>
> > > Then you can just go:
>
> > > MyImages.STORE.closeButton();
>
> > > Looks a lot better than endless GWT.create() calls, regardless of
> > > whether GWT optimizes it or not.
--~--~---------~--~----~------------~-------~--~----~
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