<?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: instance method  vs static method in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142166#M1191895</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kindly let us know if you need more inputs...&lt;/P&gt;&lt;P&gt;if you have more issues do let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Feb 2009 13:36:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-02-16T13:36:56Z</dc:date>
    <item>
      <title>instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142160#M1191889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;Moved to correct forum by moderator&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hi ppl,&lt;/P&gt;&lt;P&gt;         I have some simple doubts on ooabap-&lt;/P&gt;&lt;P&gt;        what is the advantage of using -&lt;/P&gt;&lt;P&gt;static methods over instance methods&lt;/P&gt;&lt;P&gt;static data over data&lt;/P&gt;&lt;P&gt; and which one would be a better to use in architectural and technical point of view.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Matt on Feb 16, 2009 4:33 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 06:06:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142160#M1191889</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T06:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142161#M1191890</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>Tue, 10 Feb 2009 06:12:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142161#M1191890</guid>
      <dc:creator>viquar_iqbal</dc:creator>
      <dc:date>2009-02-10T06:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142162#M1191891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instance methods gets reinitialized every time the we create the instance of the class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static methods are called only once when the program is started and they don't get reinitialized through out the execution of program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://saphelp.border-states.com/EN/c3/225b5c54f411d194a60000e8353423/frameset.htm]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 06:15:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142162#M1191891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T06:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142163#M1191892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;      Please it would me a lot appretiated and helpful to draft an answer rather then sending links.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 06:18:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142163#M1191892</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T06:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142164#M1191893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sarves, could you please elobrate on that..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 06:30:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142164#M1191893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T06:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142165#M1191894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for calling a instance method and attribute ...you have to first create intance for the class and assign reference :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ref type refrernce to cl_class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you call the method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method ref-&amp;gt;method name &lt;/P&gt;&lt;P&gt;so if u r using instance method and class you have to always worry about the instance of claa ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but in static attribute and method ...you di=ont have to worry abot the instance of class....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;simply if you want to call a method which is static of class cl_class do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call method cl_class=&amp;gt;method name&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2009 06:38:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142165#M1191894</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-10T06:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142166#M1191895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kindly let us know if you need more inputs...&lt;/P&gt;&lt;P&gt;if you have more issues do let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 13:36:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142166#M1191895</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T13:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142167#M1191896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Priyank,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly go through following.&lt;/P&gt;&lt;P&gt;It will help you to clear some your doubts.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/18/773e15778211d1b4510000e8a52bed/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/18/773e15778211d1b4510000e8a52bed/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Even don't hasitate to search on SCN / SAP Help&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pratik Vora&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 13:48:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142167#M1191896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T13:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142168#M1191897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;    Iam still not yet convinced..because one of my friend told that its good to use static methods compare to intstance method.even i heard that it saves memory in run time.isit so??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 14:17:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142168#M1191897</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T14:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142169#M1191898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;    Iam still not yet convinced..because one of my friend told that its good to use static methods compare to intstance method.even i heard that it saves memory in run time.isit so??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 14:21:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142169#M1191898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T14:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142170#M1191899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for static one memory is assigned ..but for insatnce different memory is assisgned...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instance Methods &lt;/P&gt;&lt;P&gt;You declare instance methods using the METHODS statement. They can access all of the attributes of a class, and can trigger all of the events of the class. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Static Methods &lt;/P&gt;&lt;P&gt;You declare static methods using the CLASS-METHODS statement. They can only access static attributes and trigger static events.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 14:35:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142170#M1191899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-16T14:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142171#M1191900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You use instances when it's appropriate to your program design, and you use static when that's appropriate.  Arguments about which is more "efficient" and which make best use of resource are really rather moot.  The argument you should be interested in is "which is better design".  And very generally, usually it is better to use instance rather than static.  I use statics only for information which is useful to share between instances, and for utility methods that aren't really specific to an instance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Feb 2009 15:33:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142171#M1191900</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2009-02-16T15:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142172#M1191901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Priyank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are programming at a level where you need to consider memory aspects then you are either an absolute high-end ABAP guru or a greenhorn.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My experience during the last ten years is that I never came across a memory problem and only once I had a severe performance problem which I solved with a little help from Rob Burbank:&lt;/P&gt;&lt;P&gt;[Performance of Nested Loops|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4725] &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt; &lt;B&gt;[original link is broken]&lt;/B&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to extend what Matt already pointed out:&lt;/P&gt;&lt;P&gt;- Instance Method: depends on the specific context of an instance&lt;/P&gt;&lt;P&gt;- Static Method: is independent of any specific context and therefore requires no instance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now let's assume we have a PERSON class which should have the following methods:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;- GET_SOCIAL_SECURITY_NUMBER
- VALIDATE_SOCIAL_SECURITY_NUMBER&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The social security number is a specific attribute of a person and therefore this method should be an instance method of this sample class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually such numbers are generated according to a given algorithm which, in turn, can be used to validate a given number. Since this algorithm is intended to deal with ANY input the method should be defined as static.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CONCLUSION: Instance vs. static method means context-specific vs. context-independent.&lt;/STRONG&gt;&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, 16 Feb 2009 16:19:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142172#M1191901</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-02-16T16:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142173#M1191902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi uwe,&lt;/P&gt;&lt;P&gt;          Iam just clearing my doubts thats it.iam not an abap guru,iam just a kid in front of you gurus;).iam in entry level in ooabap.anyways thanks for the response guys..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Feb 2009 04:38:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142173#M1191902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-02-17T04:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: instance method  vs static method</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142174#M1191903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Priyank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be absolutely clear: I did not mean to offend anybody but the point is that you should forget about memory in the ABAP context - unless you are really urged to consider it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And indeed I recently had a "memory" issue:&lt;/P&gt;&lt;P&gt;One of our companies wants to collect huge amounts of Idocs (up to 50'000) into a single flat file. For each collected Idoc the system creates a lock entry which resulted in an overflow dump at about 3600 IDocs. We increased the corresponding profile parameter (RZ11) by the factor 15 and never had any problems since then.&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>Tue, 17 Feb 2009 05:30:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/instance-method-vs-static-method/m-p/5142174#M1191903</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-02-17T05:30:03Z</dc:date>
    </item>
  </channel>
</rss>

