<?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: Inheritance in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817050#M918089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for inheritance&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4944654"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5148767"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 May 2008 03:31:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-05-19T03:31:30Z</dc:date>
    <item>
      <title>Inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817047#M918086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How to use inheritance concepts in oo ABAP. Please Send Some examples regarding inheritance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi S.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 May 2008 04:58:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817047#M918086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-17T04:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: Inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817048#M918087</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;go to SE80 and for example look at class CL_DOCUMENT_BCS. You  can see in tree view that this class is inherited from the class CL_DOCUMENT_BCS (under Class Agent -&amp;gt; Superclasses). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to define some class inherited from another super class then enter a name of your class and then in the first dialog window click on icon right next to Class input field and you will be able to enter name of the super class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to know more general info about inheritance in OO programming, there are plenty of articles about it on the internet. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 May 2008 10:29:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817048#M918087</guid>
      <dc:creator>mvoros</dc:creator>
      <dc:date>2008-05-17T10:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817049#M918088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inheritance is one of the basic principles of any object-oriented programming language.&lt;/P&gt;&lt;P&gt;Therefore, you should read about inheritance independent of the language.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A book I can highly recommend is [Head First Design Pattern|http://www.headfirstlabs.com/books/hfdp/]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It explains the most important &lt;EM&gt;design patterns&lt;/EM&gt; including inheritance and it also shows when to &lt;STRONG&gt;AVOID&lt;/STRONG&gt; inheritance.&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, 19 May 2008 03:24:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817049#M918088</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-05-19T03:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817050#M918089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;for inheritance&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_47x200/helpdata/en/dd/4049c40f4611d3b9380000e8353423/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4944654"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="5148767"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 03:31:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817050#M918089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T03:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817051#M918090</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;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;INHERITANCE&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Inheritance is an implementation relationship between classes that allows a class, called a subclass, to inherit all components of another class, called a superclass. In ABAP Objects, adding INHERITING FROM to the class definition statement enables inheritance .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a subclass you define additional components or redefine instance methods that were inherited from the superclass, but you can't remove inherited components. Therefore, a subclass is strongly coupled to its superclass just by containing all of the superclass's components. While a subclass knows its superclass, a superclass has no knowledge of its subclasses. Nevertheless, the semantic coupling is strong in both directions because changing a superclass automatically changes or even invalidates all of its subclasses.&lt;/P&gt;&lt;P&gt;While a subclass specializes a superclass by adding components or redefining methods, a superclass is a generalization of its subclasses. In fact, inheritance should be used to implement relationships between classes that can be described in terms of generalization and specialization. For example, if you compare a passenger_airplane class to a cargo_airplane class, you will find that many common features can be put into a general superclass, airplane.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Single inheritance. ABAP Objects supports single inheritance, which means that a class can have only one direct superclass. This rule is enforced by the syntax of the INHERITING FROM clause, which specifies the name of only one superclass. Note that the superclass can be a direct subclass of another class, but a class can never be a subclass or a superclass of itself, even across multiple steps of inheriting. Each class can have many subclasses. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Visualize the single inheritance relationship as a tree. The single root of this tree is the predefined, empty pseudo class OBJECT. The definition of a (sub)class is distributed among the classes within the branch of the inheritance tree that joins the root OBJECT with the given class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ABAP Objects does not support multiple inheritance, because one of the main design goals for ABAP Objects was to make it as simple as possible. With multiple inheritance (available in C++), a subclass can inherit directly from more than one class. This inheritance relationship is a network instead of a tree. In multiple inheritance, the rules for the namespace of components become much more complicated and may lead to naming collisions. Another problem is the so-called diamond inheritance problem: If the classes c2 and c3 inherit from a class c1, both contain all the components of c1. Now, if class c4 becomes a subclass of both c2 and c3, the problem arises of how to merge the original components of c1 into c4. However, ABAP Objects supports most of the benefits of multiple inheritance (such as the reuse of common interfaces and a wider scope polymorphism) by the separate concept of interfaces, which circumvents naming collision and the diamond inheritance problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;EXAMPLE:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT ZSUBINH.&lt;/P&gt;&lt;P&gt;CLASS C1 DEFINITION.&lt;/P&gt;&lt;P&gt; PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  METHODS : METH1.&lt;/P&gt;&lt;P&gt;  DATA : NUM TYPE I VALUE 6.&lt;/P&gt;&lt;P&gt; PROTECTED SECTION.&lt;/P&gt;&lt;P&gt;  DATA : num2 type i value 7.&lt;/P&gt;&lt;P&gt;  METHODS METH2.&lt;/P&gt;&lt;P&gt; ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C1 IMPLEMENTATION .&lt;/P&gt;&lt;P&gt; METHOD : METH1.&lt;/P&gt;&lt;P&gt;  WRITE:/5 num.&lt;/P&gt;&lt;P&gt; endmethod.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; METHOD : METH2.&lt;/P&gt;&lt;P&gt;  WRITE:/5 ' I am meth2 '.&lt;/P&gt;&lt;P&gt; ENDMETHOD.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C2 DEFINITION INHERITING FROM C1.&lt;/P&gt;&lt;P&gt; PUBLIC SECTION.&lt;/P&gt;&lt;P&gt;  METHODS : M1.&lt;/P&gt;&lt;P&gt;ENDCLASS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLASS C2 IMPLEMENTATION.&lt;/P&gt;&lt;P&gt; METHOD M1.&lt;/P&gt;&lt;P&gt;  CALL METHOD : meth1, meth2.&lt;/P&gt;&lt;P&gt;  write:/5 num2.&lt;/P&gt;&lt;P&gt; endmethod.&lt;/P&gt;&lt;P&gt;endclass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  DATA : OREF TYPE REF TO C2.&lt;/P&gt;&lt;P&gt;  CREATE OBJECT OREF.&lt;/P&gt;&lt;P&gt;CALL METHOD : OREF-&amp;gt;M1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;Suresh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 04:28:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817051#M918090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T04:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Inheritance</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817052#M918091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  Check&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_message" href="https://community.sap.com/" __jive_macro_name="message" modifiedtitle="true" __default_attr="4376395"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kiran Sure&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 May 2008 04:39:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inheritance/m-p/3817052#M918091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-05-19T04:39:47Z</dc:date>
    </item>
  </channel>
</rss>

