2007 Jun 11 10:05 AM
Hi,
I want to know under which scenario Singleton concept has to be implemented?
2007 Jun 11 10:12 AM
Hi Perumal,
Singleton is a design pattern and u might already be aware of that. singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. Sometimes it is generalized to systems that operate more efficiently when only one or a few objects exist. It is also considered an anti-pattern since it is often used as a euphemism for global variable.
Regards,
Kiran Kumar Somaroutu
2007 Jun 11 10:08 AM
HI,
You will use SINGLETON when you need to have only once instance of class , For example a SHOPPING CATALOG where everyone should see the same list of objects, in that case you willl store this instance as singleton so that the changes one makes are evident to others as soon as possible.
IN SAP if you use STATIC To implement singleton then it is SINGLETON for the user for the session, if you want single instance across the application you have to use shared objects.
Regards,
Sesh
Message was edited by:
Seshatalpasai Madala
2007 Jun 11 10:10 AM
Hi Perumal,
Singleton is a design pattern and u might already be aware of that. singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. Sometimes it is generalized to systems that operate more efficiently when only one or a few objects exist. It is also considered an anti-pattern since it is often used as a euphemism for global variable.
Regards,
Kiran Kumar Somaroutu
2007 Jun 11 10:12 AM
Hi Perumal,
Singleton is a design pattern and u might already be aware of that. singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. Sometimes it is generalized to systems that operate more efficiently when only one or a few objects exist. It is also considered an anti-pattern since it is often used as a euphemism for global variable.
Regards,
Kiran Kumar Somaroutu
2007 Jun 11 10:15 AM
Hi,
Go thru the following Blog,
/people/w.roosendaal/blog/2006/06/09/singleton-classes-in-java-beans
Regards,
Padmam.