Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

OOP's ABAP

Former Member
0 Kudos
119

Hi,

I want to know under which scenario Singleton concept has to be implemented?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
80

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

4 REPLIES 4

0 Kudos
80

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

Former Member
0 Kudos
80

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

Former Member
0 Kudos
81

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

Former Member
0 Kudos
80

Hi,

Go thru the following Blog,

/people/w.roosendaal/blog/2006/06/09/singleton-classes-in-java-beans

Regards,

Padmam.