<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Singleton Class in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855866#M47174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
program pattern_singleton.


***********************************************************************
* Singleton
* =========
*   Intent
*   ------
*   Ensure a class has only one instance, and provide a global point
*   of access to it.
***********************************************************************

class lcl_Singleton definition create private.

  public section.

    class-methods:
      get_Instance returning value(Result) type ref to lcl_Singleton.

  private section.
    class-data:
      fg_Singleton type ref to lcl_Singleton.

endclass.



class lcl_Singleton implementation.

method get_Instance.
  if ( fg_Singleton is initial ).
    create object fg_Singleton.
  endif.
  Result = fg_Singleton.
endmethod.

endclass.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Mar 2005 09:08:18 GMT</pubDate>
    <dc:creator>former_member183804</dc:creator>
    <dc:date>2005-03-13T09:08:18Z</dc:date>
    <item>
      <title>Singleton Class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855863#M47171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;Can any one give me code of singleton class.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2005 10:46:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855863#M47171</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-10T10:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton Class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855864#M47172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vinay,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you specify what the context is ? A singleton class, as I understand, is the one which has only one instance per session. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, do you want to create one class? For what purpose?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anand Mandalika.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2005 11:33:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855864#M47172</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-10T11:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton Class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855865#M47173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;create a class with definition create private to make sure that no instance can be created from outside of the class. &lt;/P&gt;&lt;P&gt;define a static attribute wich holds the instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create the instance in a class method or in the class constructor and only if the static attribute is initial. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Mar 2005 11:41:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855865#M47173</guid>
      <dc:creator>ChristianFi</dc:creator>
      <dc:date>2005-03-10T11:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton Class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855866#M47174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
program pattern_singleton.


***********************************************************************
* Singleton
* =========
*   Intent
*   ------
*   Ensure a class has only one instance, and provide a global point
*   of access to it.
***********************************************************************

class lcl_Singleton definition create private.

  public section.

    class-methods:
      get_Instance returning value(Result) type ref to lcl_Singleton.

  private section.
    class-data:
      fg_Singleton type ref to lcl_Singleton.

endclass.



class lcl_Singleton implementation.

method get_Instance.
  if ( fg_Singleton is initial ).
    create object fg_Singleton.
  endif.
  Result = fg_Singleton.
endmethod.

endclass.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Mar 2005 09:08:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855866#M47174</guid>
      <dc:creator>former_member183804</dc:creator>
      <dc:date>2005-03-13T09:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Singleton Class</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855867#M47175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the code, Klaus.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Subramanian V.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Mar 2005 03:58:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/singleton-class/m-p/855867#M47175</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-03-14T03:58:14Z</dc:date>
    </item>
  </channel>
</rss>

