commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tomasz Pik <pi...@ais.pl>
Subject XxxUtils constructors
Date Mon, 19 Aug 2002 04:35:55 GMT
(maybe this idea has been discussed yes, if yes, I'm sorry for
this email).

Why the XxxUtils classes cannot use singleton pattern, something like:

public class XUtils {

   private static XUtils _singleton = new XUtils();

   private XUtils() {
     ;
   }

   public static XUtils singleton() {
     return _singleton;
   }

   public static boolean doUtilityFunction() {
     return true;
   }
}

They'll have private constructors but people may use them inside
Velocity (as context.put("XUtils", XUtils.singleton();).

Regards
Tomek Pik
pikus@ais.pl


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message