• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using singleton pattern in java

 
Anand Jain
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give me the scenarios where Singleton pattern is used in Java?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you may need some values [which are common for the application ] from database on application startup time
 
Suhas Bilaye
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When huge objects like Hibernate Session Factory is to be created only once and the same object is to be used throughout the application
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at this thread and the links in it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic