  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | How to add new functionality to Singleton class? | How to add new functionality to Singleton class? 2005-04-04 - By Julia Liu
Back I try to correct my last question.
If I have an block of following codes:
file://-- ---- --- public class Singleton{ prvate static Singleton instance = new Singlrton();
private Singleton(){}
public static getInstance(){ return instance; }
public Object clone() throws CloneNotSupportedException{ throw new CloneNotSupportedException(); }
}
file://-- ----
If I try to add new functionality, might I create super class of Singleton?
Julia Liu
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) <DIV>I try to correct my last question.</DIV> <DIV> </DIV> <DIV>If I have an block of following codes:</DIV> <DIV> </DIV> <DIV><A href="file://-- ---- ---">file://-- ---- ---</A></DIV> <DIV>public class Singleton{</DIV> <DIV> prvate static Singleton instance = new Singlrton();</DIV> <DIV> </DIV> <DIV> private Singleton(){}</DIV> <DIV> </DIV> <DIV> public static getInstance(){</DIV> <DIV> return instance;</DIV> <DIV> }</DIV> <DIV> </DIV> <DIV> public Object clone() throws CloneNotSupportedException{</DIV> <DIV> throw new CloneNotSupportedException();</DIV> <DIV> }</DIV> <DIV> </DIV> <DIV>} </DIV> <DIV> </DIV> <DIV><A href="file://-- ----">file://-- ----</A></DIV> <DIV> </DIV> <DIV>If I try to add new functionality, might I create super class of Singleton ?</DIV><BR><BR><DIV> <DIV> <DIV> <DIV> <DIV> <DIV> <DIV> <DIV> <DIV><FONT color=#4040ff size=3><EM><STRONG><FONT size=2>Julia Liu </FONT><IMG src="http://us.i1.yimg.com/us.yimg.com/i/mesg/tsmileys2/40.gif">< /STRONG></EM></FONT></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV><p>___ __ ____ ____ ____ ____ ____ ____ ____ ____ ____<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo .com ==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|
 |