Re: Bug(?)

Marc Palmer <[email protected]> Sat, 23 Jul 2005 09:52:11 +0100
Newsgroups gmane.comp.java.webmacro.user
Organization AnyWare Ltd.
Message-ID <[email protected]>
Nikhil G. Daddikar wrote:
> Is there is a better way to get access to singletons? I access 
> singletons as $Singleton() which is mapped to the getInstance static 
> method. What I don't want to do is write context tools for each of these 
> or put("singleton", Singleton.getInstance()) in the context.

I strongly suggest, if you can, that you move away from singletons as 
they are a problem for refactoring and later changes to code - except in 
rare cases.

Look at Spring IoC if you haven't... you could use a Spring bean context 
to gather all your system components (even singletons) into a single 
bean context, and just put that bean context into the WM context - no 
100% pretty yet, but this has made me think that a ContextTool for 
exposing a Spring BeanContext would be an -excellent- addition to WM.

So, I will do it along with the new Spring MVC code and JSP taglib commits.

Shall we push 2.0 out now Lane? Keats' function fix can go in 2.1 along 
with the JSP and Spring bits.

Cheers
(BTW Lane - Am using WordPress - yes PHP driven - for small customer 
websites now)

-- 
Marc Palmer
Managing Director, AnyWare Ltd.



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click