redho home | products | services
Web Design Forums

Web Design Forums  


Web Hosting, Web Design, Software and Web Development Forums  
 FAQFAQ   MemberlistArchive  Log inLog in   RegisterRegister 
         

updating of singleton work


Goto page 1, 2  Next
 
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum
View previous topic :: View next topic  
Author Message
Ikopar



Joined: 26 May 2006
Posts: 168
I try to implement a singleton pattern: Therefore I have an abstract class with a static field "singelton" and an appropriate getter. Does updating of "singleton" work without a real instance of the class (as it is abstract)?
  Reply with quote


Jackil



Joined: 24 May 2006
Posts: 97
Ikopar, wtf
  Reply with quote
froomzer



Joined: 23 May 2006
Posts: 148
Ikopar, http://www.javapractices.com/Topic46.cjp
  Reply with quote
montanarry



Joined: 13 May 2006
Posts: 175
Yes and no. You can access the object via the abstract interface, but you can't construct an instance without a concrete class.
You need a concrete class, that is.
  Reply with quote
Klimapol



Joined: 27 May 2006
Posts: 134
Ikopar, singleton (mutable objects) suck. Immutable singleton; use enum.
  Reply with quote
Ikopar



Joined: 26 May 2006
Posts: 168
montanarry, I implemented the concrete class as private inner class in the abstract class.
  Reply with quote
montanarry



Joined: 13 May 2006
Posts: 175
Ikopar, and the nice thing about know something is you can always be wrong.
Yu can do what you asked. Be careful.
Ikopar, The short answer to your question was yes, not no.
  Reply with quote
Klimapol



Joined: 27 May 2006
Posts: 134
Ikopar, whatever you do with a singleton boils down to one or two cases.
Is it mutable? Yes or no?
  Reply with quote
Ikopar



Joined: 26 May 2006
Posts: 168
Klimapol, nope it isn't by the interface provided.
  Reply with quote
Jackil



Joined: 24 May 2006
Posts: 97
Mutable singletons are asking for trouble
  Reply with quote
Page 1 of 2 Goto page 1, 2  Next
Post new topic   Reply to topic    Web Design Forums -> JAVA programming forum


Dubai Forums - Expat Help | Vegan Chat | Java Programming | Free 3D tutorials and 3d textures | Paris Forum | EU Forum
Free Dubai Classifieds | Free London Classifieds | Jobs in London

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

Powered by phpBB © 2001, 2005 phpBB Group