Re: about singletons (ot)

2003-02-11 Thread Erik Price
: Wednesday, January 29, 2003 12:26 PM To: Tomcat Users List Subject: Re: about singletons (ot) So you mean that the original author (mike jackson) was saying that he used synchronized code blocks to apply a finer level of detail in specifying what is synchronized and what isn't, as opposed to just

RE: about singletons (ot)

2003-02-10 Thread Mike Jackson
PROTECTED] -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 29, 2003 12:26 PM To: Tomcat Users List Subject: Re: about singletons (ot) So you mean that the original author (mike jackson) was saying that he used synchronized code blocks to apply

RE: about singletons (ot)

2003-01-30 Thread WATKIN-JONES,ADAM (HP-UnitedKingdom,ex1)
snip/ Basically yes. Much less code than you normally would think needs to be declared synchronized. Maybe someone can post a link to a good guide to thread synchronization - personally I only can recommend the O'Reilly Java Thread book but that's personal taste(!) snip/ How about Concurrent

RE: about singletons (ot)

2003-01-29 Thread Ralph Einfeldt
Although possible it has several drawbacks. - Singletons that are just a class will never be garbage collected. Instance singletons can be, as soon as there is no reference to it. - If you want to pass that singleton around, you loose typesafty. (The singleton is just instance of

RE: about singletons (ot)

2003-01-29 Thread Daniel Brown
That would depend on if the constructor actually *does* something. If it needs to set up a connection pool, parse an XML configuration file, or whatever, then you have the choice of, - doing this once, reliably, in the constructor, or - making sure that every single last static method checks to

Re: about singletons (ot)

2003-01-29 Thread Erik Price
Mike Jackson wrote: The difference is that if you use a singleton there's one instance. If everything is static then you only have one copy. Usually when you use a singleton it's to control access to some resource, the intent is that you use the singleton and some synchronized calls (note I

Re: about singletons (ot)

2003-01-29 Thread Tobias Dittrich
PROTECTED] Sent: Wednesday, January 29, 2003 1:46 PM Subject: Re: about singletons (ot) Mike Jackson wrote: The difference is that if you use a singleton there's one instance. If everything is static then you only have one copy. Usually when you use a singleton it's to control access

Re: about singletons (ot)

2003-01-29 Thread Erik Price
the method call, not the execution speed of the method body ... )? Cheers Tobi From: Erik Price [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 1:46 PM Subject: Re: about singletons (ot) Mike Jackson wrote: The difference is that if you use a singleton

Re: about singletons (ot)

2003-01-29 Thread Felipe Schnack
] To: Tomcat Users List [EMAIL PROTECTED] Sent: Wednesday, January 29, 2003 1:46 PM Subject: Re: about singletons (ot) Mike Jackson wrote: The difference is that if you use a singleton there's one instance. If everything is static then you only have one copy. Usually when you use

Re: about singletons (ot)

2003-01-29 Thread Tobias Dittrich
: Wednesday, January 29, 2003 9:26 PM Subject: Re: about singletons (ot) So you mean that the original author (mike jackson) was saying that he used synchronized code blocks to apply a finer level of detail in specifying what is synchronized and what isn't, as opposed to just declaring

Re: about singletons (ot)

2003-01-28 Thread Cees van de Griend
On Tuesday 28 January 2003 22:56, Felipe Schnack wrote: These days I was thinking It's not so uncommon to have uses for singleton classes in our everyday lives. Normally we do that implementing a class that have its constructor as private, so no one can instantiate it, and a getInstance()

Re: about singletons (ot)

2003-01-28 Thread Jon Wingfield
Did someone say Booch utility? http://www.javaworld.com/javaworld/jw-04-1999/jw-04-toolbox.html see page 2. Actually, this entire set of articles on threading is excellent. Felipe Schnack wrote: These days I was thinking It's not so uncommon to have uses for singleton classes in our

RE: about singletons (ot)

2003-01-28 Thread Mike Jackson
The difference is that if you use a singleton there's one instance. If everything is static then you only have one copy. Usually when you use a singleton it's to control access to some resource, the intent is that you use the singleton and some synchronized calls (note I don't mean synchronized

RE: about singletons (ot)

2003-01-28 Thread Larry Meadors
I would agree. We had a static class and we thought it would work great...it turned out that we ended up rewriting much of it to use the getInstance() type of interface - it is just so much more flexible if you *EVER* need to change stuff. Larry [EMAIL PROTECTED] 01/28/03 16:08 PM The

RE: about singletons (ot)

2003-01-28 Thread Mike Jackson
, January 28, 2003 4:09 PM To: [EMAIL PROTECTED] Subject: RE: about singletons (ot) I would agree. We had a static class and we thought it would work great...it turned out that we ended up rewriting much of it to use the getInstance() type of interface - it is just so much more flexible