<?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: Interfaces in Classes -- seems pointless since components are all PUBLIC in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces-in-classes-seems-pointless-since-components-are-all-public/m-p/3219194#M767702</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As all components of a class moved to an Interface are all made PUBLIC is there actually ANY point in ever using Interfaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The whole point of interfaces is to be ABSTRACT and PUBLIC, otherwise they would make little sence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since a good implementation of a Class will have most of its methods and attributes defined as PRIVATE or PROTECTED there really IMO seems no point in using the whole Interface concept or have I actually missed something here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It really depends on how you use (or understand) object-oriented designs. A "good implementation" of a class will inlcude only PRIVATE or PROTECTED &lt;STRONG&gt;attributes&lt;/STRONG&gt; or at most PUBLIC READ-ONLY attributes (and only for performance reasons, i.e. microseconds). You can sure define publc methods if you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The goal of an interface is (as you suggested) to show a certain functionality to the rest of the world. A class can implement many interfaces and a client, which is holding a reference to the interface, &lt;STRONG&gt;can access only the methods defined by this interface&lt;/STRONG&gt;! The class can sure have other methods (own) or exposed by other interfaces and these can be public (or otherwise) as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also as a rule of the thumb, one should program to an interface and to an implementation - as described 12 years ago by GoF (see &lt;A href="http://en.wikipedia.org/wiki/Design_Patterns)" target="test_blank"&gt;http://en.wikipedia.org/wiki/Design_Patterns)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess, that google has a lot of examples of why to use interfaces and what are their advantages. Try a search.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Jan 2008 14:29:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-02T14:29:24Z</dc:date>
    <item>
      <title>Interfaces in Classes -- seems pointless since components are all PUBLIC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces-in-classes-seems-pointless-since-components-are-all-public/m-p/3219193#M767701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As all components of a class moved to an Interface are all made PUBLIC is there actually ANY point in ever using Interfaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Since a good implementation of a Class will have most of its methods and attributes defined as PRIVATE or PROTECTED there really IMO seems no point in using the whole Interface concept or have I actually missed something here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to tidy up several classes by using a common Interface --but I really want most of the methods and attributes to be PRIVATE with a small PUBLIC section available to "the Outside".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;jimbo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 13:34:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces-in-classes-seems-pointless-since-components-are-all-public/m-p/3219193#M767701</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T13:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Interfaces in Classes -- seems pointless since components are all PUBLIC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces-in-classes-seems-pointless-since-components-are-all-public/m-p/3219194#M767702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As all components of a class moved to an Interface are all made PUBLIC is there actually ANY point in ever using Interfaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The whole point of interfaces is to be ABSTRACT and PUBLIC, otherwise they would make little sence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since a good implementation of a Class will have most of its methods and attributes defined as PRIVATE or PROTECTED there really IMO seems no point in using the whole Interface concept or have I actually missed something here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It really depends on how you use (or understand) object-oriented designs. A "good implementation" of a class will inlcude only PRIVATE or PROTECTED &lt;STRONG&gt;attributes&lt;/STRONG&gt; or at most PUBLIC READ-ONLY attributes (and only for performance reasons, i.e. microseconds). You can sure define publc methods if you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The goal of an interface is (as you suggested) to show a certain functionality to the rest of the world. A class can implement many interfaces and a client, which is holding a reference to the interface, &lt;STRONG&gt;can access only the methods defined by this interface&lt;/STRONG&gt;! The class can sure have other methods (own) or exposed by other interfaces and these can be public (or otherwise) as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also as a rule of the thumb, one should program to an interface and to an implementation - as described 12 years ago by GoF (see &lt;A href="http://en.wikipedia.org/wiki/Design_Patterns)" target="test_blank"&gt;http://en.wikipedia.org/wiki/Design_Patterns)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess, that google has a lot of examples of why to use interfaces and what are their advantages. Try a search.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 14:29:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces-in-classes-seems-pointless-since-components-are-all-public/m-p/3219194#M767702</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-02T14:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: Interfaces in Classes -- seems pointless since components are all PUBLIC</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces-in-classes-seems-pointless-since-components-are-all-public/m-p/3219195#M767703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello James&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a SAP system available with RE-FX then have a look at class &lt;STRONG&gt;CL_RECN_CONTRACT&lt;/STRONG&gt; (Real Estate Contract).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This class implements the interfaces &lt;STRONG&gt;IF_RECA_STORABLE&lt;/STRONG&gt; and IF_RECA_BUS_OBJECT (besides many others).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A contract consists of many objects:&lt;/P&gt;&lt;P&gt;- the contract itself (CL_RECN_CONTRACT)&lt;/P&gt;&lt;P&gt;- conditions &lt;/P&gt;&lt;P&gt;- rental objects&lt;/P&gt;&lt;P&gt;- etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you update a contract all contained parts of the contract have to be updated as well. All sub-objects of the contract implement the interface IF_RECA_STORABLE as well.&lt;/P&gt;&lt;P&gt;When you save the contract the method &lt;STRONG&gt;IF_RECA_STORABLE~STORE&lt;/STRONG&gt; (implemented within class CL_RECN_CONTRACT) will be called.&lt;/P&gt;&lt;P&gt;To save the rental objects of the contract the method IF_RECA_STORABLE~STORE (implemented within class CL_REBD_RENTAL_OBJECT) will be called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming that the conditions are implemented by class CL_RECN_CONDITION_MNGR_CN you may guess yourself which interface method is called when the conditions are saved!.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I once debugged the saving of a RE-FX contract and I passed many times the STORE method call yet due to the polymorphism (by using interfaces) every time a different part of the contract was saved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2008 20:27:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/interfaces-in-classes-seems-pointless-since-components-are-all-public/m-p/3219195#M767703</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2008-01-02T20:27:06Z</dc:date>
    </item>
  </channel>
</rss>

