velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <nbu...@gmail.com>
Subject Re: How to make #for thread-safe?
Date Sun, 09 Apr 2006 17:41:07 GMT
On 4/9/06, Claude Brisson <claude@renegat.net> wrote:
> Le vendredi 07 avril 2006 à 21:27 -0700, Nathan Bubna a écrit :
> > > It would also preclude putting any singletons into the context.
> >
> > it precludes putting any *mutable* singletons in the context, and
> > that's a good thing!  i don't think mutable singletons are ever a good
> > idea, especially in a threaded application like a webapp.  they have
> > big thread-safety issues.  this will be true whether you use ASP, JSP,
> > Velocity, or any other view technology.
> >
> > immutable singletons, on the other hand, are always thread safe in any
> > application.  some people still don't like them, but they won't have
> > thread-safety issues.
>
> Isn't "mutable singleton" just a nice name for an ugly hack where you
> want a singleton to not anymore be a singleton ?

depends on who you ask.  some say even "singleton" is just a nice name
for an ugly hack. :) http://en.wikipedia.org/wiki/Singleton_pattern

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message