<?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: Determine Class and Subclass in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435458#M1052795</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halo Micky,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you maintain a seperate hierarchy of classes for Instantiation. ie a super class ZCL_FACTORY( which can be abstract or non abstract ) . Whenever you want an object you just ask the factory class to deliver the object .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie if you have a new subclass relationship type . you add one more method to the ZCL_FACTORY. By that way you do not have to do the IF ...ELSEIF statements .More Clients can actually use this factory to deliver them the required objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover make this ZCL_FACTORY non parameterised constructor .By that way you can just create an instance of  ZCL_FACTORY initially and pass this instance to the constrcutor of every class that you create.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arshad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Nov 2009 11:23:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-11-18T11:23:04Z</dc:date>
    <item>
      <title>Determine Class and Subclass</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435453#M1052790</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;I have the following 'issue': I want to create / update / retrieve BP relationships. My idea is to create a superclass with all general data for a relationship like Partner 1 &amp;amp; 2, type of relationship (employer-employee, husband-wife etc.). So far so good, but now it comes. All relationships have different attributes (created in CRM with Easy Enhancement Workbench, comparable to customer includes). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it make sense to create a subclass per relationship type, because based on that different logic has to be processed. Or put all these attributes, whether they belong to relationship type A, or B, in the same superclass? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally I would say the second option is better / more logical and put them all in ONE (super)class, but since every relationship is a specialization of the superclass due to all the different attributes, it would also make sense to create a new subclass for every relationship type. I actually want to avoid, using IF statement within the class (IF relationship A, ELSEIF relationship B, etc.), because when creating a new relationship type, I would have to change the superclass over and over again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;removed_by_moderator&amp;gt;&lt;/STRONG&gt; Hope to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Julius Bussche on Sep 12, 2008 10:35 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Sep 2008 15:44:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435453#M1052790</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2008-09-11T15:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Class and Subclass</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435454#M1052791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Micky,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do not you define the methods in INTERFACE and implement in the subclasses where ever necessary&lt;/P&gt;&lt;P&gt;with concept of Inheritance..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you repeatedly change the implementation part of the methods so better define in interface and inherit &lt;/P&gt;&lt;P&gt;the interface from a class and proceed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this would help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck&lt;/P&gt;&lt;P&gt;Narin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Sep 2008 08:51:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435454#M1052791</guid>
      <dc:creator>narin_nandivada3</dc:creator>
      <dc:date>2008-09-12T08:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Class and Subclass</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435455#M1052792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This question has become very much alive again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this really the way to go, creating an interface? Any other alternatives?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 08:08:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435455#M1052792</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-11-17T08:08:53Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Class and Subclass</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435456#M1052793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like you want to implement the Open Closed Principle. You can try using the Interface or Abstract Super Class. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When using the Abstract Super Class, you need to create the Factory method, which can give back you the object reference of your required relationship. So, when ever you introduce a new relationship, you can change this method, or make the implementation of the Factory method dynamic i.e. all subclass for this superclass will have the same prefix with suffix as the relationship name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may find these blogs useful:&lt;/P&gt;&lt;P&gt;/people/naimesh.patel/blog/2009/05/20/object-oriented-design-principles-oodp-open-closed-principleocp&lt;/P&gt;&lt;P&gt;/people/naimesh.patel/blog/2009/05/26/object-oriented-design-principles-oodp-ocp-with-business-scenario&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Nov 2009 14:51:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435456#M1052793</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2009-11-17T14:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Class and Subclass</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435457#M1052794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Naimesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;really sounds like something I could definitely use for my 'problem'. Pnts. rewarded, although not yet fully implemented since we are only in design phase. But I will try and do it like this. I already read your blogs in the past, but totally forgot about it (shame on me). Thanks for reminding me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gr. Micky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 10:42:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435457#M1052794</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-11-18T10:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Class and Subclass</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435458#M1052795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Halo Micky,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you maintain a seperate hierarchy of classes for Instantiation. ie a super class ZCL_FACTORY( which can be abstract or non abstract ) . Whenever you want an object you just ask the factory class to deliver the object .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie if you have a new subclass relationship type . you add one more method to the ZCL_FACTORY. By that way you do not have to do the IF ...ELSEIF statements .More Clients can actually use this factory to deliver them the required objects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Moreover make this ZCL_FACTORY non parameterised constructor .By that way you can just create an instance of  ZCL_FACTORY initially and pass this instance to the constrcutor of every class that you create.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arshad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 11:23:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435458#M1052795</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-11-18T11:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Determine Class and Subclass</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435459#M1052796</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;Whenever you want an object you just ask the factory class to deliver the object &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And what object would that be?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Gr. Micky.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Nov 2009 11:46:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/determine-class-and-subclass/m-p/4435459#M1052796</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-11-18T11:46:49Z</dc:date>
    </item>
  </channel>
</rss>

