posted 15 years ago
Hello friends !
I was asked when will one need to go for a Singleton class in and EJB application ?
I mean which condition ? when will you want this ?
Can anyone help ?
Thank you all in advance..
Leena
I was asked when will one need to go for a Singleton class in and EJB application ?
I mean which condition ? when will you want this ?
Can anyone help ?
Thank you all in advance..
Leena
[SCJP2, SCWCD1.3, SCBCD]
posted 15 years ago
I describe one situation for using singletonhere.
Kyle
Kyle
Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Manish_Mudgal
Greenhorn
Posts: 2
posted 15 years ago
Hi,
If you are using Serive locator pattern then you can make that singleton,to give one service at a time
Originally posted by Leena Diwan:
Hello friends !
I was asked when will one need to go for a Singleton class in and EJB application ?
I mean which condition ? when will you want this ?
Can anyone help ?
Thank you all in advance..
Leena
Hi,
If you are using Serive locator pattern then you can make that singleton,to give one service at a time
posted 15 years ago
HI Leena,
The Singleton's purpose is to control object creation, limiting the number to one but allowing the flexibility to create more objects if the situation changes. Since there is only one Singleton instance, any instance fields of a Singleton will occur only once per class, just like static fields.
Singletons often control access to resources such as
1.Database connections or
2.sockets
Thanks
viswa
Viswanatha GB
1.
[ May 23, 2002: Message edited by: viswagb ]
The Singleton's purpose is to control object creation, limiting the number to one but allowing the flexibility to create more objects if the situation changes. Since there is only one Singleton instance, any instance fields of a Singleton will occur only once per class, just like static fields.
Singletons often control access to resources such as
1.Database connections or
2.sockets
Thanks
viswa
Viswanatha GB
1.
[ May 23, 2002: Message edited by: viswagb ]
==============(**)=================<br />Viswanatha.G.B<br />Sr.Software Engineer<br />IBM<br />==============(**)=================

Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |