<?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: Get instance method and design pattern in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429399#M1245844</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; For most of the classes where you find GET_INSTANCE method the classes instantiation would be marked as PRIVATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the get_instance method would be public and static. This is to make sure that the instantiation of the class is done by the class itself in the get_instance mehod. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is one way of getting the singleton pattern.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Mar 2009 08:33:45 GMT</pubDate>
    <dc:creator>seshatalpasai_madala</dc:creator>
    <dc:date>2009-03-23T08:33:45Z</dc:date>
    <item>
      <title>Get instance method and design pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429396#M1245841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I New to abap objects and i read the help and some stuff from the forum,&lt;/P&gt;&lt;P&gt;l like to now more about design pattern in abap objects,&lt;/P&gt;&lt;P&gt;2. I saw in some abap class the use of method of GET_INSTANCE i think it's from factory pattern , what is the pros. and cons to use this method ,when i should consider to use it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance &lt;/P&gt;&lt;P&gt;Nina&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Mar 2009 21:26:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429396#M1245841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-22T21:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Get instance method and design pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429397#M1245842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2009 05:01:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429397#M1245842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-23T05:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Get instance method and design pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429398#M1245843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Nina&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A very good introduction into design patterns is the book "&lt;EM&gt;Head First: Design Patterns&lt;/EM&gt;". Here you will find many good reasons why and when to use the factory pattern.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should use the factory pattern when&lt;/P&gt;&lt;P&gt;- you want to prevent "direct" instantiation (i.e. using a public CONSTRUCTOR method) by the developer&lt;/P&gt;&lt;P&gt;- you want to hide the complexity of instantiation from the user of the class&lt;/P&gt;&lt;P&gt;- the instantiation creates an implementation of an interface and you want to keep control of which implementing class is returned&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2009 06:45:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429398#M1245843</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-03-23T06:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: Get instance method and design pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429399#M1245844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt; For most of the classes where you find GET_INSTANCE method the classes instantiation would be marked as PRIVATE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the get_instance method would be public and static. This is to make sure that the instantiation of the class is done by the class itself in the get_instance mehod. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is one way of getting the singleton pattern.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2009 08:33:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429399#M1245844</guid>
      <dc:creator>seshatalpasai_madala</dc:creator>
      <dc:date>2009-03-23T08:33:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get instance method and design pattern</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429400#M1245845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Hello Nina&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; A very good introduction into design patterns is the book "&lt;EM&gt;Head First: Design Patterns&lt;/EM&gt;". Here you will find many good reasons why and when to use the factory pattern....&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's one of the essentials for me when I designing new applications.  Very very useful!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2009 08:55:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-instance-method-and-design-pattern/m-p/5429400#M1245845</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-03-23T08:55:25Z</dc:date>
    </item>
  </channel>
</rss>

