<?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: ABAP-OO: Another Layer (1 Interface) vs. extending N Interfaces? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-another-layer-1-interface-vs-extending-n-interfaces/m-p/10361900#M1839085</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Update 05.08.2014:&lt;/STRONG&gt; I decided to go with&lt;/P&gt;&lt;P&gt;C) create a seperate filter-object which explicitly filters the tables retrieved by e.g. get_object_calculations( ).&lt;/P&gt;&lt;P&gt;Reasoning: Separation of Concerns, explicit semantic of filtering, no need to update all interfaces or regenerate caching-layer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Aug 2014 07:11:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-08-05T07:11:46Z</dc:date>
    <item>
      <title>ABAP-OO: Another Layer (1 Interface) vs. extending N Interfaces?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-another-layer-1-interface-vs-extending-n-interfaces/m-p/10361899#M1839084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt;this is a crosspost from &lt;/SPAN&gt;&lt;SPAN __default_attr="html" __jive_macro_name="code"&gt;&amp;lt;a href="http://stackoverflow.com/questions/23869744/another-layer-1-interface-vs-extending-n-interfaces" data-mce-href="http://stackoverflow.com/questions/23869744/another-layer-1-interface-vs-extending-n-interfaces"&amp;gt;Stackoverflow&amp;lt;/a&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;, any advice greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have an Data-Access Layer (SAP ABAP, but the language does not matter here) where I have 1 interface per entity/database-table, like&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;IF_DATA_CONTRACT_HEAD-&amp;gt;get_contract_header( )&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;IF_DATA_OBJECT_CALC-&amp;gt;get_object_calculations( )&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;40 more ...&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;These interfaces are implemented by the actual database-access class-impls and a generated caching-layer, which is pretty simple since the methods really do not have any parameters and just return "the relevant" data.In certain consumers however, I require a filtered access to the returned data, specifically I need to get the data of all interfaces (~50) constrained by contract-position.So, do you recommend to&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;OL&gt;&lt;LI&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/UL&gt;&lt;SPAN&gt;A) extend all interfaces by an optional parameter like IF_DATA_CONTRACT_POSITION-&amp;amp;gt;get_contract_positions(&lt;/SPAN&gt;&lt;A href="https://community.sap.com/OPTIONAL-FILTER"&gt;&lt;/A&gt;&lt;SPAN&gt;) which means my impl and my caching-layer gets more complex&lt;/SPAN&gt;&lt;UL class="noindent"&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;B) should I create another interface IF_DATA_FILTER_CONTRACT_POSITION-&amp;gt;set_contract_position_filter? for the sole purpose of explicitly filtering data-acesss&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;A) When extending every existing interface (the ~40-50 listed above) with the optional contract-position filter/constraint, the API is quite clean and would look like the following:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="jive-pre"&gt;&lt;CODE&gt;&lt;SPAN&gt;result = lo_data_object_calc-&amp;gt;get_object_calculations( &amp;lt;FILTER&amp;gt; ).&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;As already mentioned, it would require me to extend every implementation, the data-access as well as the generated caching-layer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;B) With the explicit filter-interface IF_DATA_FILTER_CONTRACT_POSITION on the other hand, I would have yet another interface-layer around data-access and I could generate the uncoupled filtering impls. I would neither need to touch the actual data-access impl nor the generated cache-layer. However, the usage would be a little more clumsy, like&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="jive-pre"&gt;&lt;CODE&gt;&lt;SPAN&gt;TRY. " down-cast from data-interface to filter-interface&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; DATA lo_object_filter ?= lo_data_object_calc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; lo_object_filter-&amp;gt;set_contract_position_filter( &amp;lt;FILTER&amp;gt; ).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CATCH could_not_cast.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;SPAN&gt; RAISE i-need-a-filter-impl!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ENDTRY.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;result = lo_data_object_calc-&amp;gt;get_object_calculations( ).&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 May 2014 14:39:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-another-layer-1-interface-vs-extending-n-interfaces/m-p/10361899#M1839084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-05-26T14:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP-OO: Another Layer (1 Interface) vs. extending N Interfaces?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-another-layer-1-interface-vs-extending-n-interfaces/m-p/10361900#M1839085</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Update 05.08.2014:&lt;/STRONG&gt; I decided to go with&lt;/P&gt;&lt;P&gt;C) create a seperate filter-object which explicitly filters the tables retrieved by e.g. get_object_calculations( ).&lt;/P&gt;&lt;P&gt;Reasoning: Separation of Concerns, explicit semantic of filtering, no need to update all interfaces or regenerate caching-layer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 07:11:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-oo-another-layer-1-interface-vs-extending-n-interfaces/m-p/10361900#M1839085</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-08-05T07:11:46Z</dc:date>
    </item>
  </channel>
</rss>

