<?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: good/bad programming from OOPS perspective in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576450#M22646</link>
    <description>&lt;P&gt;We recommend to organize &lt;STRONG&gt;large&lt;/STRONG&gt; programs in includes.&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abensource_code_modular_guidl.htm" target="test_blank"&gt;https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abensource_code_modular_guidl.htm&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;For class pools and function groups it is a must anyhow.&lt;/P&gt;
  &lt;P&gt;For reports, it is your decision, from which point on, it is better to create includes. &lt;/P&gt;
  &lt;P&gt;This is independent from ABAP objects.&lt;/P&gt;
  &lt;P&gt;For large local classes, it is not a bad idea to put declaration part and implementation part into different includes, where the declaration include then should be included in a top include.&lt;/P&gt;
  &lt;P&gt;But never, never, never reuse includes.&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenmultiple_use_include_guidl.htm" target="test_blank"&gt;https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenmultiple_use_include_guidl.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Nov 2017 16:23:13 GMT</pubDate>
    <dc:creator>retired_member</dc:creator>
    <dc:date>2017-11-27T16:23:13Z</dc:date>
    <item>
      <title>good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576438#M22634</link>
      <description>&lt;P&gt;Folks,&lt;/P&gt;
  &lt;P&gt;If I have one INCLUDE for all CLASS DEFINITIONs and one for CLASS IMPELEMENTAION and invoking those class in the main program, will be considered as a bad programming approach from OOPS perspective ?&lt;/P&gt;
  &lt;P&gt;ZPROG.&lt;/P&gt;
  &lt;P&gt;ZINCLUDE1."for all class definitions&lt;/P&gt;
  &lt;P&gt;ZINCLUDE2."for all class implementations&lt;/P&gt;
  &lt;P&gt;invoking those class and methods here in the ZPROG.&lt;/P&gt;
  &lt;P&gt; (or)&lt;/P&gt;
  &lt;P&gt;Defining all the class definition and implementations in ZPROG (without using INCLUDES) and then invoking them there itself.&lt;/P&gt;
  &lt;P&gt;Is having an INCLUDE comes under the purview of using OOPS in the first place or INCLUDES will be considered as Classical approach of programming.&lt;/P&gt;
  &lt;P&gt;Kindly opine.&lt;/P&gt;
  &lt;P&gt;Thanks,&lt;/P&gt;
  &lt;P&gt;K.Kiran.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 09:22:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576438#M22634</guid>
      <dc:creator>kiran_k8</dc:creator>
      <dc:date>2017-11-27T09:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576439#M22635</link>
      <description>&lt;P&gt;Hello Kiran,&lt;/P&gt;
  &lt;P&gt;As per the ATC/SCI/SLIN checks the class definition include [ (L)Z...Dnn ] should be defined in the TOP include of the program or function-pool. The implementation include [ (L)Z...Pnn ] should be part of the main program.&lt;/P&gt;
  &lt;P&gt;If you don't follow this structure, then you get a warning message from the checks. &lt;/P&gt;
  &lt;P&gt;Cf. &lt;A href="https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abensource_code_modular_guidl.htm" target="test_blank"&gt;https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abensource_code_modular_guidl.htm&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;Personally i don't follow this structure when defining reports. It's easier to have everything in one place &amp;amp; makes life easier when refactoring.&lt;/P&gt;
  &lt;P&gt;IMHO i don't relate using(or not using) includes to OOP. Infact a CLASS-POOL itself is structured in several includes! &lt;/P&gt;
  &lt;P&gt;BR,&lt;/P&gt;
  &lt;P&gt;Suhas&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 09:41:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576439#M22635</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2017-11-27T09:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576440#M22636</link>
      <description>&lt;P&gt;Completely agree, I don't think SAP guidelines are appropriate in this instance.&lt;/P&gt;
  &lt;P&gt;There's a technical reason too: using Eclipse it's a pain to work with synchronization of definitions and code in separate units, so I gave up on that a long time ago. In my opinion it's better to group classes by function if anything.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 11:47:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576440#M22636</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2017-11-27T11:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576441#M22637</link>
      <description>&lt;P&gt;The &lt;STRONG&gt;historic &lt;/STRONG&gt;intention of Includes was&lt;/P&gt;
  &lt;OL&gt;
   &lt;LI&gt;prevent the editor from loading the whole source code because of a low network bandwith&lt;/LI&gt;
   &lt;LI&gt;reusage of code&lt;/LI&gt;
  &lt;/OL&gt;
  &lt;P&gt;Regarding 1.) I think in this times we just can ignore this&lt;/P&gt;
  &lt;P&gt;Regarding 2.) the use of local classes in your Z-Report tells me, that you will never reuse your code&lt;/P&gt;
  &lt;P&gt;&lt;STRONG&gt;Conclusion&lt;/STRONG&gt;: don't use Includes at all, there's really no need of them anymore.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 12:08:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576441#M22637</guid>
      <dc:creator>UweFetzer_se38</dc:creator>
      <dc:date>2017-11-27T12:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576442#M22638</link>
      <description>&lt;P&gt;If think there's also point 3. Includes can still be useful for organizing source code for a better readability. I like to see the main code immediately when I display the main include of the program.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 12:24:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576442#M22638</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-11-27T12:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576443#M22639</link>
      <description>&lt;P&gt;The only "main code" in my programs nowadays is &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;NEW app( )-&amp;gt;main( ).&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Because we are not using any global variables anymore (of course &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; ), the report always starts with the Class definitions (or selection screen).&lt;/P&gt;
  &lt;P&gt;To navigation to the statements (main method) we have the outline or quick-outline (&amp;lt;ctrl&amp;gt;-O).&lt;/P&gt;
  &lt;P&gt;So, I can't really agree that there is a point 3.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 12:36:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576443#M22639</guid>
      <dc:creator>UweFetzer_se38</dc:creator>
      <dc:date>2017-11-27T12:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576444#M22640</link>
      <description>&lt;P&gt;Bingo &lt;SPAN class="mention-scrubbed"&gt;se38&lt;/SPAN&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Code snippet from my productive code&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/86449-2017-11-27-14-10-15.jpg" /&gt;&lt;/P&gt;
  &lt;P&gt;Maybe it's a good idea for me to switch to &lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;NEW app-&amp;gt;start_main( ).&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Nov 2017 13:14:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576444#M22640</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2017-11-27T13:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576445#M22641</link>
      <description>&lt;P&gt;Maintainability can be a reason to split large programs.&lt;/P&gt;
  &lt;P&gt;If a developer wants to change a piece of code they will lock the entire report in a transport. If FOO classes are in include A, BAR classes in include B, and SALV classes in include C, then developers can lock, work on, and transport these independently.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 13:30:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576445#M22641</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2017-11-27T13:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576446#M22642</link>
      <description>&lt;P&gt;Hmm, maybe the design of the report is wrong...(?)&lt;/P&gt;
  &lt;P&gt;If it's really such a large program, you should extract classes into global workbench classes. &lt;/P&gt;
  &lt;P&gt;Advantage: every method is locked separatley in a transport request.&lt;/P&gt;
  &lt;P&gt;In my opinion only the program logic (the "App", flow logic) should be a local class. Every business object should be a workbench class, although they are not used in other projects.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 13:49:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576446#M22642</guid>
      <dc:creator>UweFetzer_se38</dc:creator>
      <dc:date>2017-11-27T13:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576447#M22643</link>
      <description>&lt;P&gt;I guess it's a matter of approach. I prefer to keep things as local as makes sense. It only takes a couple of minutes to turn a local class into a global when it makes sense.&lt;/P&gt;
  &lt;P&gt;I agree with business objects, but I see little benefit in globalising internal classes just for the sake of program size. Typical examples of local stuff: MVC controllers, SALV views and support classes, and any report-specific functionality. This can grow quite big already. Sometimes I will group individual SALV controller and related view and support classes into their own includes.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 14:53:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576447#M22643</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2017-11-27T14:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576448#M22644</link>
      <description>&lt;P&gt;Ok, than my question is: where do you see the advantage of an Include against a global class?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 15:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576448#M22644</guid>
      <dc:creator>UweFetzer_se38</dc:creator>
      <dc:date>2017-11-27T15:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576449#M22645</link>
      <description>&lt;P&gt;My point was also an extra point to the historic reason.&lt;/P&gt;
  &lt;P&gt;Nowadays, if you have local classes, there might be many class definition lines before START-OF-SELECTION. NEW app( )-&amp;gt;main( ). (or even many lines of selection screen as in Suhas example)&lt;/P&gt;
  &lt;P&gt;I still prefer to put these definition lines in one extra include, just to keep the main part immediately visible, but of course with only one line of code, then going to the end of the source is my first reflex. So, INCLUDE or not, it's not a big deal.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 15:49:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576449#M22645</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2017-11-27T15:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576450#M22646</link>
      <description>&lt;P&gt;We recommend to organize &lt;STRONG&gt;large&lt;/STRONG&gt; programs in includes.&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abensource_code_modular_guidl.htm" target="test_blank"&gt;https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abensource_code_modular_guidl.htm&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;For class pools and function groups it is a must anyhow.&lt;/P&gt;
  &lt;P&gt;For reports, it is your decision, from which point on, it is better to create includes. &lt;/P&gt;
  &lt;P&gt;This is independent from ABAP objects.&lt;/P&gt;
  &lt;P&gt;For large local classes, it is not a bad idea to put declaration part and implementation part into different includes, where the declaration include then should be included in a top include.&lt;/P&gt;
  &lt;P&gt;But never, never, never reuse includes.&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenmultiple_use_include_guidl.htm" target="test_blank"&gt;https://help.sap.com/http.svc/rc/abapdocu_752_index_htm/7.52/en-US/index.htm?file=abenmultiple_use_include_guidl.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 16:23:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576450#M22646</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2017-11-27T16:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576451#M22647</link>
      <description>&lt;P&gt;It is not only about reports but also about function groups that you still might use for technical reasons (update, classical screens).&lt;/P&gt;
  &lt;P&gt;Here all productive code should be implemented in local classes and these in their includes. It makes no sense to create global classes for the internals of function groups or other kinds of programs, especially since we don't have a package section.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 16:35:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576451#M22647</guid>
      <dc:creator>retired_member</dc:creator>
      <dc:date>2017-11-27T16:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: good/bad programming from OOPS perspective</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576452#M22648</link>
      <description>&lt;P&gt;Horst just provided one part of my intended answer when he wrote "But never, never, never reuse includes."&lt;/P&gt;
  &lt;P&gt;I treat includes are local to the program (although people can break those rules but then that's their responsibility). Global classes are effectively released for all &amp;amp; sundry to use as they please. &lt;/P&gt;
  &lt;P&gt;It's partly personal style too, I write code and refine, rename and refactor often before my final version is ready, this is quick and easy in local classes, especially with Eclipse. &lt;BR /&gt;My globals often start life this way too for the same reason - I also don't like 15 transports with method renames and deletions, which tends to be the case on projects with daily transports.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Nov 2017 16:42:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/good-bad-programming-from-oops-perspective/m-p/576452#M22648</guid>
      <dc:creator>pokrakam</dc:creator>
      <dc:date>2017-11-27T16:42:11Z</dc:date>
    </item>
  </channel>
</rss>

