Singleton Pattern: Additional Interest 2003-12-17 - By Kancharlapalli,Sridhar
Back The main purpose of singleton is to restrict the number of object instances been created.
"Math class is an example of Static-Singleton", this strategy has it's own drawbacks as it can't be extended. So, it is best suitable for utility classes. Main purpose of making this class a Static-Singleton is for better memory management.
Regards, -Sridhar Kancharlapalli.
-- --Original Message-- -- From: tetsuo [mailto:tetsuo@(protected)] Sent: Wednesday, December 17, 2003 3:56 PM To: J2EEPATTERNS-INTEREST@(protected) Subject: Re: Singleton Pattern: Additional Interest
I don't understand your question... Singleton pattern doesn't have all methods static, but only one (getInstance()). The Math class is an utility class ,not a (GoF) pattern.
Vishwanath Dubey wrote: > Hi, > > What is additional interest of using Singleton pattern apart of using all > the method declared as Static like Math class and no inteset of overriding > of methods of the class? > > > Thanks & Regds > Vishwanath
"The question of whether computers can think is like the question of whether submarines can swim." - Edsger Dijkstra
===================================================================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)
===================================================================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)
|
|