Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: David L.   on Nov 29 In Java Category.

  
Question Answered By: Edwin Chavez   on Nov 29

One more example of Using Singleton can be as below.

Say in a web based application you need to load the data which is
required very often.
You can load the data at the first call to the method which loads
the data. Later on whenever the data is required return the same
instance.

In suchj case it will be checked whether the instance already exists.
E.g.

if (properties != null)
{
Invoke the method which returns the properties object.
}
else
{
Return the same object.
}

Just one more example where you can use the Singleton implmentation.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 


Tagged: