<?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 [DESIGN PATTERN] Factory: Define Method Area in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/design-pattern-factory-define-method-area/m-p/10269974#M1831002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question regarding the Design Pattern:Factory. According my need the question is below as:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have the Abstract Class &lt;STRONG&gt;AAA&lt;/STRONG&gt; with it own Abstract method that create objects&lt;EM&gt; (only one method)&lt;/EM&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;I have a Final Sub-Class&amp;nbsp; &lt;STRONG&gt;BBB&lt;/STRONG&gt; with 20 instantiate methods + the inherited method from Class AAA.&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;BBB&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;bbb1&lt;/STRONG&gt;().&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;BBB&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;bbb2&lt;/STRONG&gt;().&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;BBB&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;bbb3&lt;/STRONG&gt;().&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;I have a Final Sub-Class&amp;nbsp; &lt;STRONG&gt;CCC&lt;/STRONG&gt; with 10 instantiate methods + the inherited method from Class AAA.&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;CCC&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;ccc1&lt;/STRONG&gt;().&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;CCC&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;ccc2&lt;/STRONG&gt;().&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;CCC&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;ccc3&lt;/STRONG&gt;().&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Afterwards:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Class &lt;STRONG&gt;BBB&lt;/STRONG&gt; is instantiated through the Factory. The TYPE of &lt;STRONG&gt;BBB&lt;/STRONG&gt; is &lt;STRONG&gt;AAA&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;Class &lt;STRONG&gt;CCC&lt;/STRONG&gt; is instantiated through the Factory. The TYPE of &lt;STRONG&gt;CCC&lt;/STRONG&gt; is &lt;STRONG&gt;AAA&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could I use the 20 methods of &lt;STRONG&gt;BBB&lt;/STRONG&gt; without to declare them in AAA &lt;EM&gt;(without inheritance)&lt;/EM&gt;. Because, if I declare them in AAA, consequently they will be visible in CCC. And I don't want to ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;DATA &lt;SPAN style="color: #0000ff;"&gt;BBB&lt;/SPAN&gt; TYPE REF TO &lt;SPAN style="color: #ff0000;"&gt;AAA&lt;/SPAN&gt;.&lt;SPAN style="color: #808080;"&gt;&lt;EM&gt; "Var Object BBB is type of Class AAA&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;DATA &lt;SPAN style="color: #800080;"&gt;CCC&lt;/SPAN&gt; TYPE REF TO &lt;SPAN style="color: #ff0000;"&gt;AAA&lt;/SPAN&gt;.&lt;EM style="color: #808080;"&gt; "&lt;EM style="color: #808080;"&gt;Var &lt;/EM&gt;Object CCC&lt;EM style="color: #808080;"&gt; is type of&lt;/EM&gt; Class AAA&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;BBB&lt;/SPAN&gt; = AAA=&amp;gt;Factory( '&lt;SPAN style="color: #008000;"&gt;BBB&lt;/SPAN&gt;' ).&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;CCC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = AAA=&amp;gt;Factory( '&lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;CCC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;' ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #808080;"&gt;&lt;EM&gt;" I want to call, in that way:&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;&lt;SPAN style="color: #0000ff;"&gt;BBB&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;method_&lt;SPAN style="color: #0000ff;"&gt;bbb&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;1().&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;CCC&lt;/SPAN&gt;-&amp;gt;method_&lt;SPAN style="color: #800080;"&gt;ccc&lt;/SPAN&gt;1().&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;CCC&lt;/SPAN&gt;-&amp;gt;method_&lt;SPAN style="color: #ff0000;"&gt;bbb1&lt;/SPAN&gt;(). &lt;SPAN style="color: #ff0000;"&gt;&lt;EM&gt;" RAISE ERROR &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a way but I don't know if it's breaking the rules of the Factory Concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you got any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rachid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 May 2014 13:08:21 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-05-03T13:08:21Z</dc:date>
    <item>
      <title>[DESIGN PATTERN] Factory: Define Method Area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/design-pattern-factory-define-method-area/m-p/10269974#M1831002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question regarding the Design Pattern:Factory. According my need the question is below as:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt;"&gt;I have the Abstract Class &lt;STRONG&gt;AAA&lt;/STRONG&gt; with it own Abstract method that create objects&lt;EM&gt; (only one method)&lt;/EM&gt;.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;I have a Final Sub-Class&amp;nbsp; &lt;STRONG&gt;BBB&lt;/STRONG&gt; with 20 instantiate methods + the inherited method from Class AAA.&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;BBB&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;bbb1&lt;/STRONG&gt;().&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;BBB&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;bbb2&lt;/STRONG&gt;().&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;BBB&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;bbb3&lt;/STRONG&gt;().&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;I have a Final Sub-Class&amp;nbsp; &lt;STRONG&gt;CCC&lt;/STRONG&gt; with 10 instantiate methods + the inherited method from Class AAA.&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;CCC&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;ccc1&lt;/STRONG&gt;().&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;CCC&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;ccc2&lt;/STRONG&gt;().&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;CCC&lt;/STRONG&gt;-&amp;gt;method_&lt;STRONG&gt;ccc3&lt;/STRONG&gt;().&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Afterwards:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Class &lt;STRONG&gt;BBB&lt;/STRONG&gt; is instantiated through the Factory. The TYPE of &lt;STRONG&gt;BBB&lt;/STRONG&gt; is &lt;STRONG&gt;AAA&lt;/STRONG&gt;.&lt;/LI&gt;&lt;LI&gt;Class &lt;STRONG&gt;CCC&lt;/STRONG&gt; is instantiated through the Factory. The TYPE of &lt;STRONG&gt;CCC&lt;/STRONG&gt; is &lt;STRONG&gt;AAA&lt;/STRONG&gt;.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could I use the 20 methods of &lt;STRONG&gt;BBB&lt;/STRONG&gt; without to declare them in AAA &lt;EM&gt;(without inheritance)&lt;/EM&gt;. Because, if I declare them in AAA, consequently they will be visible in CCC. And I don't want to ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;DATA &lt;SPAN style="color: #0000ff;"&gt;BBB&lt;/SPAN&gt; TYPE REF TO &lt;SPAN style="color: #ff0000;"&gt;AAA&lt;/SPAN&gt;.&lt;SPAN style="color: #808080;"&gt;&lt;EM&gt; "Var Object BBB is type of Class AAA&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;DATA &lt;SPAN style="color: #800080;"&gt;CCC&lt;/SPAN&gt; TYPE REF TO &lt;SPAN style="color: #ff0000;"&gt;AAA&lt;/SPAN&gt;.&lt;EM style="color: #808080;"&gt; "&lt;EM style="color: #808080;"&gt;Var &lt;/EM&gt;Object CCC&lt;EM style="color: #808080;"&gt; is type of&lt;/EM&gt; Class AAA&lt;/EM&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;BBB&lt;/SPAN&gt; = AAA=&amp;gt;Factory( '&lt;SPAN style="color: #008000;"&gt;BBB&lt;/SPAN&gt;' ).&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;CCC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt; = AAA=&amp;gt;Factory( '&lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;CCC&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;' ).&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #808080;"&gt;&lt;EM&gt;" I want to call, in that way:&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;&lt;SPAN style="color: #0000ff;"&gt;BBB&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;-&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;method_&lt;SPAN style="color: #0000ff;"&gt;bbb&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;1().&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;CCC&lt;/SPAN&gt;-&amp;gt;method_&lt;SPAN style="color: #800080;"&gt;ccc&lt;/SPAN&gt;1().&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="color: #800080;"&gt;CCC&lt;/SPAN&gt;-&amp;gt;method_&lt;SPAN style="color: #ff0000;"&gt;bbb1&lt;/SPAN&gt;(). &lt;SPAN style="color: #ff0000;"&gt;&lt;EM&gt;" RAISE ERROR &lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have found a way but I don't know if it's breaking the rules of the Factory Concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you got any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rachid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 May 2014 13:08:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/design-pattern-factory-define-method-area/m-p/10269974#M1831002</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-03T13:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: [DESIGN PATTERN] Factory: Define Method Area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/design-pattern-factory-define-method-area/m-p/10269975#M1831003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Noone ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 08:38:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/design-pattern-factory-define-method-area/m-p/10269975#M1831003</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-05T08:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: [DESIGN PATTERN] Factory: Define Method Area</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/design-pattern-factory-define-method-area/m-p/10269976#M1831004</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;If you have declared the methods in abstract class as protected or public and if you are inheriting it to the sub classes, then the methods will be available in the subclasses. There is no way to restrict like few abstract methods needs to be inherited and others need not be inherited. The inherited classes are forced to implement the abstract methods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your scenario, i do not think there is a need of abstract class, as I assume that both of your classes does some stand alone logic( as per your question ) compared to the other and doesn't have any common operations. Could you please let us know about this in detail ?? What about INTERFACES ?, Please have a look into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kesav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 May 2014 09:31:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/design-pattern-factory-define-method-area/m-p/10269976#M1831004</guid>
      <dc:creator>former_member214313</dc:creator>
      <dc:date>2014-05-05T09:31:15Z</dc:date>
    </item>
  </channel>
</rss>

