ABAP-OO: Another Layer (1 Interface) vs. extending N Interfaces?

Hello,
this is a crosspost from Stackoverflow, any advice greatly appreciated.
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
IF_DATA_CONTRACT_HEAD->get_contract_header( )
IF_DATA_OBJECT_CALC->get_object_calculations( )
40 more ...
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
A) extend all interfaces by an optional parameter like IF_DATA_CONTRACT_POSITION->get_contract_positions() which means my impl and my caching-layer gets more complex
B) should I create another interface IF_DATA_FILTER_CONTRACT_POSITION->set_contract_position_filter? for the sole purpose of explicitly filtering data-acesss
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:
result = lo_data_object_calc->get_object_calculations( <FILTER> ).
As already mentioned, it would require me to extend every implementation, the data-access as well as the generated caching-layer.
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
TRY. " down-cast from data-interface to filter-interface
DATA lo_object_filter ?= lo_data_object_calc.
lo_object_filter->set_contract_position_filter( <FILTER> ).
CATCH could_not_cast.
RAISE i-need-a-filter-impl!
ENDTRY.
result = lo_data_object_calc->get_object_calculations( ).

Update 05.08.2014: I decided to go with
C) create a seperate filter-object which explicitly filters the tables retrieved by e.g. get_object_calculations( ).
Reasoning: Separation of Concerns, explicit semantic of filtering, no need to update all interfaces or regenerate caching-layer.

Similar Messages

  • My PS 6 ext. flips to another layer when I try to work.

    HI    I'm working with CS 6 extended.  when I select a layer then try to move it PS switches layers and I end up moving the wrong layer

    Chances are you have Auto-Select chosen in the Options bar of the Move tool
    and you are clicking in an area of the Layer that reveals another layer.
    Uncheck it.

  • Trying to edit psd file and it adds another layer

    I have a psd file that was created to use as a template (it is all text).  When I try to edit it, it won't let me, instead another layer is added to the file, instead of allowing me to edit the layer that I am in.......what am I missing???

    If it's been rasterized, you will not be able to edit it.  You'll have to re-create the text layer.  The trouble is that since it was a template, you may not have the fonts that were used to originally create the template.

  • How can I have text from multiple fields on one layer, copy to one field on another layer?

    A little help please as it's been years since I've done any coding of any sort.
    So I have a 4 page document with various field types.  I have a document script that gets "TodaysDate" that works perfectly and a few other scripts as well.
    So what I'm trying to do is find a work around for the following:
    I have 3 fields - SURNAME, FIRSTNAME & dob.
    And I want what is typed into these fields to populate into 1 field.  And according to this tutorial (http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript) it's not exactly possible.  At least I think that's what it says.
    However I'm hoping that maybe I could have a Submit button at the end of that document that when clicked would copy the text from those 3 fields (that I would have on 1 layer) into 1 field on a 2nd layer.  Is that even possible??
    I'd also like to have the document Print, Save (using the text in the field on the 2nd layer as the file name), Email (using the text in the field on the 2nd layer as the subject line) and Export to a specific Excel spreadsheet. 
    I don't want much do I?
    I'm using Acrobat 9 Pro on a Windows PC but also have access to Acrobat 8 Professional.  And I'm going to want the form to run in Acrobat Reader X.
    So far I have for the 3 fields into 1 on another layer:
    function buttonClick(){
    if(buttonClick==false)
    event.value=this.getField("SURNAME"+"-"+"FIRSTNAME"+"-"+"dob").valueAsString;
    But I have no idea how to call the event.value from 1 layer to another or if any of that code above would even work at all.
    I have a script that I believe will work perfectly for the Save and Email function:
    Using the “doc.submitForm()” function
    // This is the form return e-mail. Its hardcoded
    // so that the form is always returned to the same address
    // Change address on your form
    var cToAddr = "[email protected]";
    // First, get the client CC e-mail address
    var cCCAddr = this.getField("ClientEmail").value;
    // Now get the beneficiary e-mail only if it is filled out
    var cBenAddr = this.getField("BennyEmail").value;
    if(cBenAddr != "") cCCAddr += ";" + cBenAddr;
    // Set the subject and body text for the e-mail message
    var cSubLine = "Form X-1 returned from client"; var cBody = "Thank you for submitting your form.\n" + "Save the mail attachment for your own records";
    //** Send the form data as an XML attachment on an e-mail
    // Build the e-mail URL
    var cEmailURL = "mailto:[email protected]?cc=" + cCCAddr + "&subject=" + cSubLine + "&body=" + cBody;
    this.submitForm({
                cURL: cEmailURL,
                cSubmitAs:"XML",
                cCharSet:"utf-8"
    I'll work out the Export to Excel thing later as I've seen many tutorials on that.  But can I do the 3 fields to 1 thing at all?
    Please Help!!!

    Sorry Gilad.  I hope I'm not getting on your nerves (too much) but as I said it's been a while since I did any formal code. And I'm trying to do this code for a work document but I'm doing it in amongst so many other things I do for my job that it's difficult to get the time to concentrate for longer than 5 mins.
    I didn't get a chance to try that code until just now.  I guess I asked again as I thought (from what I'd read) that it wouldn't be that simple.
    So I've added that code and I get no errors.  But it doesn't appear to be doing anything either.  I've added the code like this in the Custom calculation script of a separate field I've called FileName.  And on the Button i'm using I've added:  buttonClick()
    function buttonClick(){
    if(buttonClick==false)
              event.value=this.getField("SURNAME").valueAsString + "-" + this.getField("FIRSTNAME").valueAsString + "-" + this.getField("dob").valueAsString;
    So now I'm guessing that becasue i'm not getting an error or a result that I've screwed it up still.  Have I put the code in the correct area?  Have I assigned a the buttonClick() function correctly?

  • XI 7.0 ABAP-Mapping in Design Builder (Interface Mapping)

    Hi,
    in XI 3.0 there was the possibility to specify a ABAP-Mapping-Class in the Interface Mapping. In XI 7.0 the
    entry ABAP-Mapping is somehow missing in the drop-down-Box, there is a Message-Mapping, JAVA-Mapping and XSLT-Mapping but no ABAP-Mapping :-(.
    Did this move somewhere else or are ABAP-Mapping's not possible anymore ??
    Best Regards,
    Frank Marx

    Frank,
    You need to activate ABAP and XSLT mapping.
    Check this blog for the same,
    /people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
    Regards,
    Bhavesh

  • I place a psd file with transparent background on another layer in my InDesign document. The layer b

    I placed a psd file with transparent background on another layer in my InDesign document. The layer below has a color (RGB). When the psd file is placed it changes the color on the layer below. I've tried other psd files thinking something is wrong with my file, but get the same result. I have tried for days to figure this out. Can anyone help me?

    Wow, thank you! That was fast. I googled that question to death and even bought (another) book on CS5 and never saw that answer. Thank you so much. You made a very good ending to my day! I'd buy you a beer if I could!!

  • Photoshop cs6 error "could not use the type tool because the target channel is hidden.  happens when im typing in photoshop, go to another layer and then come back. can't alter text at that point

    photoshop cs6 error "could not use the type tool because the target channel is hidden.  happens when im typing in photoshop, go to another layer and then come back. can't alter text at that point.  i really need to get thsi figured out. thank you.

    You may have answered my question. I AM using the 64bit version of Illustrator CS6. I had no idea there were bugs in it that affected paths copied and pasted from Illustrator to Photoshop.
    A bit more about what I'm trying to accomplish... I'm trying to follow Deke's tutorial (http://www.deke.com/content/dekes-techniques-018-creating-a-3d-pie-chart) which is already difficult since so much has changed between CS5.5 and 6, but then on top of that, I keep getting errors!
    So I created the pie chart exactly as he shows and copied and pasted into Photoshop exactly as he does. Before submitting this post, though, I tried drawing just two very simple triangle shapes, copying them both and pasting them into Photoshop as a shape layer. The shapes weren't overlapping, but they were a part of the same shape layer just like the pie chart tutorial.
    Thanks for your help. If there is anything else I should try before just giving up because of the 64bit bugs, please let me know.

  • Help: photoshop cs4 crashes when i drag a layer under or over another layer/try to change layer orde

    help: photoshop cs4 crashes when i drag a layer under or over another layer/try to change layer order
    this problem orcurred suddenly after having used the programm for years.
    i tried to reinstall cs4 and install all available updates, but it di not help...
    please help ! thanks

    What is the exact version and what’s your OS?
    What does the crash report state?
    Boilerplate-text:
    Are Photoshop and OS fully updated and have you performed the usual trouble-shooting routines (trashing prefs by pressing command-alt-shift/ctrl-alt-shift while starting Photoshop until the appropriate dialog appears after making sure all customized presets like Actions, Patterns, Brushes etc. have been saved and making a note of the Preferences you’ve changed, 3rd party plug-ins deactivation, system maintenance, cleaning caches, font validation, etc.)

  • How do I select a color range like in Photoshop OR copy/move a layer into the mask of another layer?

    Hi there,
    I'm trialling Photoshop Elements and wanting to use a black and white (grey scale) layer that I've made as a mask in another layer and don't know how to do it in Elements.  In Photoshop, I'd do this (there maybe a better way in PS to do it, but I haven't discovered it yet)...
    Click the layer i've created that I intend to use as a mask
    Select All
    Copy
    select layer that I want the mask to be applied to
    click the Add Layer Mask button (at the bottom of the Layers window)
    click the mask icon so it is highlighted (and the image isn't)
    switch to Channels view
    highlith the Layer Mask beneath the R,G,B layers and make it visible
    Paste
    make it invisible again
    switch back to layers.
    This works and retains the full range of transparency for semi transparency and soft edges of the mask etc.
    Alternatively, I can select a Color Range, but that doesn't seem to be available in PS Elements.
    So, how do I achieve the same result in PS Elements?
    Thanks for your help
    Jonno

    Perfect!   Thanks very much R_Kelly.  That does exactly what I was hoping to do.
    Cheers
    Jonno

  • Layer palette issue. I choose a layer and when I use move tool on that layer PSCC jumps to another layer

    I am Using Photoshop CC 14.2.1x32. When I choose a layer in the layers palette and then use the move tool to re-position an element on that layer, PS forces a jump to another layer. The only way I can re-position is by using free transform on the layer I want to work on. What is happening with PS CC? Please help. About to dump CC and go back to CS 6

    You might have been able to change the Auto Select option from the default Group to the usually more user friendly Layer.  It's one heck of a useful feature, so get used to using it if you can.  For instance, if you have a lot of layers, it can make it a lot easier just to find a particular layer in the layers panel.

  • Aligning a layer relative to another layer with an Action

    I was wondering if there is a way to get a layer to align itself underneath another layer.
    Example:
    Layer 1 is text: NEW YORK
    Layer 2 is text: YANKEES
    NEW YORK is where I want it at the top of the design.
    YANKEES is way at the bottom.
    I click on the action and it moves YANKEES to a set position right underneath NEW YORK to look like this:
    NEW YORK
    YANKEES
    ... then batch would open the next PSD file and it would repeat the process, moving BULLS underneath CHICAGO making
    CHICAGO
    BULLS  
    the align tool works fine for things like  centering, moving to top, etc during an action. However, what I am  trying to do in batch is align something like YANKEES underneath NEW  YORK and then use a batch process to duplicate this on several designs. 
    HOWEVER, what ends up happening, is that the move tool action will move  the layer but it remembers the original distance... in other words in  the next design, CHICAGO will overlap BULLS or DODGERS will be to far  away from LOS ANGELES. Because the size of the CHICAGO, NEW YORK, LOS  ANGELES, etc changes.
    Any help is appreciated!!!

    You could use "Data Driven Graphics" and set place holders for the two text layers.
    Other than that a script is your best bet. The following script will look for two text layers within the document and place the bottom text five pixels below the top text keeping them left aligned.
    N.B. Only two text layers are supported.
    #target photoshop
    main();
    function main(){
    if(!documents.length) return;
    selectAllLayers();
    var selectedLayers = getSelectedLayersIdx();
    var textLayers =[];
    for(var a in selectedLayers){
    makeActiveByIndex( Number(selectedLayers[a]), false );
    if(activeDocument.activeLayer.kind == LayerKind.TEXT){
         var LB =getLayerBoundsByIndex(selectedLayers[a] );
    textLayers.push([[selectedLayers[a]],[LB[0]],[LB[1]],[LB[2]],[LB[3]]]);
    if(textLayers.length != 2){
        alert("Only two text layers are supported!");
        return;
    textLayers.sort(function(a,b){return a[2]-b[2];});
    var startRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    makeActiveByIndex( Number(textLayers[1][0]), false );
    var deltaX = Number(textLayers[0][1]) - Number(textLayers[1][1]);
    var deltaY = (Number(textLayers[0][4]) + 5) - Number(textLayers[1][2]);
    activeDocument.activeLayer.translate(deltaX,deltaY);
    app.preferences.rulerUnits = startRulerUnits;
    function selectAllLayers(){
    activeDocument.activeLayer = activeDocument.layers[activeDocument.layers.length-1];
    if(activeDocument.activeLayer.isBackgroundLayer)
    activeDocument.activeLayer = activeDocument.layers[activeDocument.layers.length-2];
    var BL = activeDocument.activeLayer.name;
    activeDocument.activeLayer = activeDocument.layers[0];
        var desc5 = new ActionDescriptor();
            var ref3 = new ActionReference();
            ref3.putName( charIDToTypeID('Lyr '), BL);
        desc5.putReference( charIDToTypeID('null'), ref3 );
        desc5.putEnumerated( stringIDToTypeID('selectionModifier'), stringIDToTypeID('selectionModifierType'), stringIDToTypeID('addToSelectionContinuous') );
        desc5.putBoolean( charIDToTypeID('MkVs'), false );
        executeAction( charIDToTypeID('slct'), desc5, DialogModes.NO );
    function getLayerBoundsByIndex( idx ) {
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID("Prpr") , stringIDToTypeID( "bounds" ));
        ref.putIndex( charIDToTypeID( "Lyr " ), idx );
        var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID( "bounds" ));
        var bounds = [];
        bounds.push(desc.getUnitDoubleValue(stringIDToTypeID('left')));
        bounds.push(desc.getUnitDoubleValue(stringIDToTypeID('top')));
        bounds.push(desc.getUnitDoubleValue(stringIDToTypeID('right')));
        bounds.push(desc.getUnitDoubleValue(stringIDToTypeID('bottom')));
        return bounds;
    function getSelectedLayersIdx(){
          var selectedLayers = new Array;
          var ref = new ActionReference();
          ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
          var desc = executeActionGet(ref);
          if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
             desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
              var c = desc.count
              var selectedLayers = new Array();
              for(var i=0;i<c;i++){
                try{
                   activeDocument.backgroundLayer;
                   selectedLayers.push(  desc.getReference( i ).getIndex() );
                }catch(e){
                   selectedLayers.push(  desc.getReference( i ).getIndex()+1 );
           }else{
             var ref = new ActionReference();
             ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "ItmI" ));
             ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
             try{
                activeDocument.backgroundLayer;
                selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ))-1);
             }catch(e){
                selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )));
          return selectedLayers;
    function makeActiveByIndex( idx, visible,add ){
        if(visible == undefined) visible = false;
        if(add == undefined) add=false;
        var desc = new ActionDescriptor();
          var ref = new ActionReference();
          ref.putIndex(charIDToTypeID( "Lyr " ), Number(idx))
          desc.putReference( charIDToTypeID( "null" ), ref );
          if(add) desc.putEnumerated(stringIDToTypeID('selectionModifier'), stringIDToTypeID('selectionModifierType'), stringIDToTypeID('addToSelection'));
          desc.putBoolean( charIDToTypeID( "MkVs" ), visible );
       executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );

  • Is it possible to use a masked layer to mask another layer?

    Hi there,
    I'm relatively new to Fireworks after coming from an Illustrator background
    I've just started playing with the masking features of Fireworks and wanted to know if it was possible to use a layer that already has a mask applied as a further mask on another layer.
    Basically, I have a rounded rectangle that I am using as a canvas to hold a series of vector circles. Circles that fall outside the rectangle are naturally clipped due to the mask.
    I then want to use these clipped circles as a mask for a series of photos that also lie within the rounded rectangle.
    I suppose I could simply cut up the circles to ensure that they are within the rectangle, but this would not allow me to resize them in future should I want to alter the design.
    In Illustrator I could use a clipping mask to achieve the required effect, which would basically clip all the layers beneath, but in Fireworks I'm not sure what to do.
    Any ideas or different approaches would be appreciated!
    Cheers,
    Tim

    Between the ability to select thumbnails in the Layers panel, and occasional use of Select > Subselect, you've actually got pretty good options for editing a simple mask. Once you start nesting them, though, you'll probably have to ungroup.
    The cool thing is, you've got options for nesting masks and working non-destructively. And grouping and ungrouping isn't a big deal, particularly if you remember the shortcuts for it (Command-G and Shift-Command-G). On the other hand, it might be nicer if Fireworks offered the ability to "unfurl" a group or a mask via an arrow, while still seeing the full effect of the mask.
    I just tried out my earlier symbol suggestion and realized that while one can apply a mask to a symbol instance, it may not be possible to apply a symbol instance as a mask, which is a bit surprising. (At least, that option seemed to be greyed-out in CS6.) So my earlier idea may just be purely theoretical.

  • Actions- move object to another layer

    Is it possible in Illustrator CS4 to record an action that selects a particular object in a layer called base & move the selected object into another layer called blue & lock the layer that the object was moved? Any suggestions are welcome

    An Action can record the assignment of a Note to a selected object.
    An Action can select an object by its Note.
    An Action can record the locking of a Layer if it is done in the Layer Options dialog, not by just clicking the Lock icon.
    The problem is recording a step that will switch you to another Layer. However, selecting an object makes its Layer the current Layer. So, you can, for example:
    Assume you have two Layers: Base and Blue.
    Assume there is an object on Layer Blue with a Note: "OnBlue".
    Assume there is a selected object on Layer Base that you want to move to Layer Blue.
    The Action would:
    1. Cut the selected object to the Clipboard.
    2. Lock the current Layer Base. (Toggle Dialog Off.)
    3. Select the object that is noted “OnBlue”. (Thus, LayerBlue becomes the current Layer.)
    4. Paste (or PasteInFront or PasteInBack to cause it to paste in the same location).
    JET

  • A layer disappears whenever I change another layer

    Hello wise Photoshop helpers!
    One of my layers continues to disappear whenever I change another layer in my file, no matter what I do to the other layers.
    If I try to erase something on another layer the one disappears.
    I also cannot locate where this illusive layer is because it never goes away when I hit the Eye to make my layers disappear or appear. It only disappears when I change something on the doc
    (i.e. type, paint, order of layers, etc.)
    When I save and restart, the layer is back but if I try to continue editing, it goes away again.
    I need to get this done but it's very difficult without all of may layers being visible so I feel as if I'm working in the dark. :/ Please help!
    Thank you!
    ~Kelly

    Thank you so much for responding!
    I have three adjustment layers that have a little chain next to them on the layers panel that i assume would mean they are linked. To what though, i am not quite sure.
    When I say "disapear" I mean it disapears from view on the actual image. I cannot find where this layer is located on the layers panel. When I make all my layers not visible with the visibility being turned off, It still remains, and there are no layers visible on the layers panel but I can see it on the image itself.
    Then if I edit the doc in anyway other than visibility, then the layer disapears from view on the actual image.
    Also, once I save and restart Photoshop, it always comes back. I could continue working without the layer but then I will have to continue to restart photoshop to see how it looks all together with the disapearing layer. lol
    Thank you so much for any help you can provide!
    -Kelly

  • How can I make an image appear partially in front and partially behind another layer in Adobe Illustrator?

    How can I make an image appear partially in front and partially behind another layer in Adobe Illustrator?

    Put the image behind the layer (at the back of it or on a layer below). With it still selected, Copy.
    Now Paste in Front (Ctrl+F). Depending on your Paste Remembers Layers setting, you may have to bring the newly pasted copy to the front, or to the upper layer.
    Draw a shape over the image to define the portion of it you want to appear "in front."
    With the shape and the image selected, clip the image using the shape. (Object > Clipping Mask > Make)

Maybe you are looking for

  • How can I get my Indesign script to apply to all pages in the document?

    My script (java) shown below will only apply to the first page of the document. How can i get it to apply to all pages of my document? What am I missing? Thanks. scirpt: myDocument = app.activeDocument with (myDocument.pages.item(0).marginPreferences

  • Netboot will not working, getting globe, then flashing folder with question mark.

    I just created a netboot image which went off without any problems.  I copied the two .nbi folders to my NetBootSP0 folder, and enabled them within netboot.  My OS X server which is my netboot server and dhcp server.  When I boot using N or Option N,

  • Can you use Sony NS400 speakers with Apple Tv

    Can you use Sony NS400 wifi speakers with Apple TV Thanks Hugh

  • Ipad attack

    Good morning, Im on vacations in Puntal del este Uruguay. I was conected trough a 3g /Wi fi secured network to the internet. I was chating with amazon customer care. in the middle of the discussion, part of my screen turned ligh blue, like when im se

  • Web Dynpro ABAP: How to do checkboxes in table column?

    Hi, In Web Dynpro for ABAP, I have a table, where one column consists of check boxes, and the user should be able to check some boxes in some lines. In the context of my view, I created a node tied to a DDIC structure, with some attributes. The attri