Use injection. The difference is that there is no way to override the implementation of the static accessor / singleton for testing functionality. If you instead use an IoC container (Spring / Guice) and injection, you are not statically tying yourself to a single class. Work off the interface, and all the places in your code that use that interface can be changed to use a different implementation without changing each of them - just change the config as to which one is injected.
-- Jeremy Thomerson http://www.wickettraining.com On Fri, May 15, 2009 at 10:21 AM, alf.redo <alfredo.alean...@logobject.ch> wrote: > > Hi James, > I would like to know what is the difference between a Singleton class with a > static accessor method and POJO stored into my WebApplication class (with > proper getter). > What is the preferred way to set an application scoped object? > > Thank you again... > > > -- > View this message in context: > http://www.nabble.com/Application-scope-vs-Singleton-tp23559402p23562038.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org