chris wilson
{phone}
tel + 616.471.9142
fax +
616.471.6900
{email}
[EMAIL PROTECTED]
{web}
http://www.wondergeek.com
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference [mailto:[EMAIL PROTECTED]]On Behalf Of Matt Krevs
Sent: Tuesday, December 07, 1999 8:21 PM
To: [EMAIL PROTECTED]
Subject: Re: Singleton Class -RE: [Fwd: using ResultSet with JSP?]Singletons definitely have a place in java.If you're writing OO code you usually want to use interfaces. Interfaces cannot have static methods so the singleton model fits in really well when you have a number of classes that you only want to instantiate once bu also want them to implement interfaces.I used to have heaps of static methods in a host of classes but moved over to using interfaces and the singleton model and it is _much_ cleaner. Static methods have their place but dont dismiss the singleton pattern.-----Original Message-----
From: A mailing list about Java Server Pages specification and reference [mailto:[EMAIL PROTECTED]]On Behalf Of Sachin Aggarwal
Sent: Wednesday, December 08, 1999 10:57 AM
To: [EMAIL PROTECTED]
Subject: Singleton Class -RE: [Fwd: using ResultSet with JSP?]You can use static methods and variables. Singleton pattern is over-kill - In the true OO world a class has multiple instances because they have seperate behavior and data. If there is only one instance, then it's probably class behavior that you have. Sine Java is not true OO and doesn't really support extending class behavior - the static methods and behavior come closest to class behavior.
Sachin.
p.s - there are ways to make sure your class is not garbage collected - you can use - noclassgc option
> -----Original Message-----
> From: Cory L Hubert [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 07, 1999 2:46 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [Fwd: using ResultSet with JSP?]
>
>
> I am using JRUN and JSP 1.0. I want to use a
> ConnectionPool class that I
> have created. It uses the Singleton Design Pattern. How
> can I make it so
> that I only have one instance of this class and all the JSP
> pages & Beans
> use that one instance.
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
>
