"Sullivan, Craig R." wrote:
>
> What are the advantages/disadvantages of a singleton
> class vs a class with all static methods and all static
> class members.
>

 This is kind of off-topic, but I'll mentally add
"within a servlet container", and suggest some issues
based on that:

 a) It's hard to discuss outside the context of a
particular problem. Why, exactly, do you want a
singleton? Eg, factory singletons sometimes need
to be replaceable, so they're objects instead of
all-static classes. Or are you wanting to make sure
there is only one instance of a thread pool?

 b) Within a servlet container, you're going to
have a hard time guaranteeing that there is really
a single instance (of object or class). Classes
are identified with a particular classloader, and
different webapps use different class-loaders. And
if your webapp is distributable, you get even more
fun. Then again, maybe that doesn't matter to you,
see (a) above.


-cks

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to