Can delegate and strategy patterns coexist ?

Say I have an interface for persistence call that PersistenceInterface.
Now for MySQL I created MySQLPersistenceClass and for DB2 I created one more class DB2PersistenceClass.
Now to proceed with my busines slogic I have a class BusinessLogicHandler class.
BusinessLogicHandler has a class member say persistenceObject of type PersistenceInterface. Now certainly I'm switching the persistence based on the actual implementation so I say Im using STRATEGY pattern here
But for create operation from business layer i.e. BusinessLogicHandler.create directly invokes persistenceObject.create in this case can I say that Im using DELEGATE pattern also
So can I say the set of classes and interface = DELEGATE + STRATEGY ?
Thanks a lot

Can someone please answer this ?yes
can I say the set of classes and interface = DELEGATE + STRATEGY ?yes
Can delegate and strategy patterns coexist ?yes
I'd say it would be odd to use Strategy not as a delegate.

Similar Messages

  • Can BW and R/3 Coexist?

    Hi,
    I apologize in advance if this is the wrong forum to ask this question.
    Can BW and SAP R/3 both reside on the same server/host but on seperate DB (Oracle)?  We are looking to migrate to new hardware but was not sure if both those applications can coexist.  Does SAP have a recommendation or stance on this? A note or faq would also be great.
    Thanks for your help.
    Newbie

    Hi Rick,
    It is possible to have the configuration you mention.
    It is not feasible to use a MCOD solution with you R/3 and BW system under Oracle. The oracle tuning for OLAP is different to the OLTP tuning.
    From an SAP perspective, I think it is your choice. My main concern is if you can isolate CPUs for each instance. Can BW consume all the CPUs and leave none for R/3 and vice versa. Most people implement partition of servers using their vendors solution for isolating memory and CPUs to avoid such issues and simplify administration(e.g. splitting a SUN server into domains).
    I do not believe you will find a SAP note on this as it a hardware solution.
    I hope this helps,
    Mike.

  • Urgent: Can MS and Oracle providers coexist?

    I need to make a quick decision, so would appreciate any definitive input on whether the Microsoft and Oracle .Net Data Providers can co-exist peacefully on the same workstations or the same server. I need to have different apps/services on the same computer access different instances of Oracle 8i, one using MS' provider, and one using Oracle's provider. We would use the newest 9i Client.
    Can anyone say whether they coexist peacefully?

    Thanks for the information, though the comment about the lack of Microsoft support for the 9i Client appears to be out of date. I just received confirmation from our Microsoft technical sales support rep and a priority support services analyst that Microsoft DOES officially support it's Managed .Net Provider for Oracle with the 9i client. The support will be limited to supported features, but all standard support services will be provided (e.g. diagnosis assistance and hot fixes). I have also received confirmation from both Microsoft (via priority support) and Oracle (via MetaLink) that the two company's providers can coexist on the same computer.
    Interestingly, the most comprehensive support for Oracle features seems to be in a third-party provider - OraDirect from Core Labs. This product would eliminate my need to use two providers to support existing and new applications. Unfortunately, my employer is too conservative to take a chance on a third party driver.

  • Can 32bit and 64bit clients coexist?

    Hello folks,
    I have a Windows Server 2003 64bit machine running Websphere 6.0 Express (32bit). Additionally it's running a custom 64bit application. Both apps need to connect to separate 10g databases. Can the 32bit and 64bit Oracle client installs coexist on this machine?
    Thanks for any advice!
    -Sangamon

    To clarify, Websphere needs a 32bit JDBC driver, our custom application needs a 64bit ODBC driver. I've got Websphere working, but I'm having trouble getting the ODBC driver to work. I'm wondering if there's a problem with having 2 clients installed.

  • Can Declarative and Classic provisioning coexist?

    How do I use both classic and declarative provisioning together? If I just throw a EntryPointNotImplementedException exception from the IMVSynchronization.Provision method for the MAs that I want to use Sync Rule  to provision? Or both of them will
    be triggered?

    Hello,
    both of the attributes flows will processed every time.
    Just implement sync rules and classic ma rules like you need.
    sync rules will be processed first, after that classic rules are evaluated, so Keep in mind classic ma rules can overwrite sync rules if you implement both for the same attribute.
    Regards
    Peter
    Peter Stapf - ExpertCircle GmbH - My blog:
    JustIDM.wordpress.com

  • [solved: I am a dope] Can gcc and gcc-multilib coexist?

    If I try to install gcc-multilib, it conflicts with my existing 64-bit gcc package. Is there a way for me to install it in another path or install the binaries from gcc-multilib as gcc32, g++32 etc?
    Last edited by rhd (2012-02-20 02:50:55)

    rhd wrote:
    I'm learning 32-bit assembly and the tutorial I am using has a small collection of example code and a little library which needs a 32-bit copy of libgcc.a.
    libgcc.a is owned by gcc and not gcc-libs and so here I am, attempting to install the multilib package instead of the 64-bit version. The -m32 flag doesn't help. [edit: the -m32 flag to gcc, which tells it to compile for a 32 bit arch]
    $ nosr libgcc.a
    core/gcc
    community/arm-elf-gcc-base
    community/arm-wince-cegcc-gcc
    community/avr-gcc
    community/mingw32-gcc
    community/mingw32-gcc-base
    multilib/gcc-multilib
    I tried to point out that gcc-multilib provides gcc. Everything gcc does, you can do with gcc-multilib. You can't have both installed at the same time (but you wouldn't want/need to, either).
    Last edited by falconindy (2012-02-18 15:01:10)

  • Strategy pattern question.

    Can the following scenario be called strategy pattern?
    public class StrategyExecutor {
         public static void main(String[] args) {
              Strategy[] strategies = {new FirstImpl(), new SecondImpl()};
              for(int i = 0; i < strategies.length; i++){
                   System.out.print("Strategy ["+ i +"] ");
                   strategies.solve();
    public interface Strategy {
         public void solve();
    public abstract class AbstractClass implements Strategy{
         public void solve(){
              int result = getFirstParam()+getSecondParam();
              System.out.println(" Result "+result);
         protected abstract int getSecondParam();
         protected abstract int getFirstParam();
    public class FirstImpl extends AbstractClass {
         protected int getSecondParam() {          
              return 22;
         protected int getFirstParam() {          
              return 11;
    public class SecondImpl extends AbstractClass {
         protected int getSecondParam() {
              return 44;
         protected int getFirstParam() {          
              return 33;

    To be a perfect fit for Strategy pattern, if the abtract class which has the template to solve() is not there and the actual algorithm is down in the FIrstImpl, SecondImpl then its a true strategy?
    Design point of view it can be a strategy pattern..
    but If you see from the the context and the programs
    objective, It is not strategy pattern

  • Strategy Pattern and HotSpot optimization

    I wonder whether using the Strategy Pattern affects HotSpot optimizations such as inlining. Assume for a non trivial operation that has to be done often there exist two alternatives which are frequently exchanged (i.e. the flag in the example changes its value frequently). Originally code looked like this:if ( caseSensitive ) {
       caseSensitiveComparison( strA, strB );
    else {
       caseInsensitiveComparison( strA, strB );
    }Assume both methods are private then that code can be inlined quite easily by the HotSpot engine.
    If we now delegate to a StringComparator (defined as interface and implemented by two singletons) we getcomparator.compareStrings( strA, strB );Is the VM still able to inline this? Or is it likely that overall performance degrades since the virtual call is not optimized away?
    Any ideas?
    Thanks!
    robert
    For further info on the Strategy Pattern see here
    http://c2.com/cgi/wiki?StrategyPattern

    That's true, but OTOH he describes a realistic (?)
    scenario in the first paragraph that explains inlining
    could occur.That's good news.
    However, what I found more valuable is his statement,
    that a virtual call is not necessarily worse than a
    local conditional (branch prediction hassles).Just to be clear, I'm not advocating the use of if instead of Strategy in some hope that it will result in inlining. Personally, I feel that the whole idea that OO slows things down is overblown. While it may add complications and more instructions at a microscopic level, OO often simplfies and reduces actions at a macroscopic level.
    I'm more interested in knowning what are the inlining requirements and triggers. Along the lines of the understanding why it's sometimes bad practice to use + for String concatenation, I'd like to know if there are simple things that can be done to improve performance with out changing the overall design.
    If anyone has any information on this it would be much appreciated.

  • Business delegate and Session facade design patterns

    Does any one tell me, what is the difference between business delegate and session facade design patterns.

    1. Session Facade decouples client code from Entity beans introducing session bean as a middle layer while Business Delegate decouples client code from EJB layer ( Session beans).
    2. SF reduces network overhead while BD reduces maintenance overhead.
    3. In SF any change in Session bean would make client code change.
    While in DB client is totally separate from Session bean because BD layer insulate client from Session beans(EJB layer).
    3. In only SF scenario, Client coder has to know about EJB programming but BD pattern no EJB specialization needed.
    4.SF emphasizes on separation of Verb, Noun scenario while BD emphasizes on separation of client(presentable) and EJB layer.
    Anybody pls suggest more differences ?

  • Can Struts and JSF coexist?

    I have a Struts based application and now I want to build an additional module on top of that using pure JSF. My question is, can Struts and JSF co-exist in the same application? If yes, what are the cons of that approach? What are the places I need to tweak in the configuration files so that they work together?
    thanks,

    Hi,
    Yes they can coexist. Actually that's the approach recommended by Craig McClanahan. I have developed a full enterprise application (80% completed) which uses JSF in front and Struts in the back using Struts-Faces integration library (developed by Apache).
    So far I haven't faced any major issues with this approach. However, I haven't try using Struts validator on JSF objects.
    Read the article below on how to integrate JSF w/ Struts.
    http://www.oracle.com/technology/pub/articles/masterj2ee/j2ee_wk8.html

  • URGENT!!! Can ATA and SCSI coexist?

    hello fellas!
    my case is similar of the post "Can SCSI and ATA coexist?', but with some differences:
    I own a G4 Dual 500–MHz PowerPC G4, 40Gb ATA + 80GB ATA. (http://support.apple.com/specs/powermac/PowerMac_G4_GigabitEthernet.html)
    now I've installed a PCI SCSI card to connect tree more SCSI HDs: two barracuda 18Gb and one quantum 36Gb)
    my G4 only reads SCSI drives when I disconnect ATA tape from motherbard...
    when I plug ATA to motherboard again, neither SCSI mount on desktop, nor system profile shows it as a device, even when I start Hard Drive Update 1.app...
    I've read all manuals from apple, jumped all SCSI HDs, but for some reason, it doesn't work at all!
    so, the question, again, is Can ATA and SCSI coexist?
    does anyone knows how to config it??
    thanks in advance!
    b
    G4 Dual 500–MHz PowerPC G4   Mac OS X (10.4.8)   [email protected]

    answering:
    - as my primary language is portuguese, i didn't understand when you said 'booting off the OS X disk'. do you mean eject it in the disk utility?
    - I have so many drives because e sold another G4 that used those drives atached with the pci card and I simply want to use it, because I'm short on cash... those drives are installed with OS 9.2 (the ATA ones are running OS 10.4.8)
    when you said one ATA and 2 SCSI, you mean that if I simply disconnect the slave ATA and one of the SCSI it may works?
    thanks again!
    b

  • Hi there - I have a Mac and use the 15.0 version of Adobe Illustrator. I can't locate the pattern tool under the 'Options' tab. I also checked the help section and it doesn't exist.

    Hi there - I have a Mac and use the 15.0 version of Adobe Illustrator. I can't locate the pattern tool under the 'Options' tab. I also checked the help section and it doesn't exist.

    Thanks Manish!
    I was following the instructions my teacher sent and there was no mention of what program the tutorial used. I ended up finding a pattern tutorial for CS5.
    Rosa

  • Can Quicktime X and 7 Pro coexist?

    Can Quicktime X and 7 Pro coexist? Can you have both installed at the same time? I would guess not. Man I really had to bite my tongue on this post! Okay, just one word - hodgepodge.

    Hold it right there. One issue I found that I is causing me fits right now is that even if you have both X and 7 Pro installed it still has some how corrupted some of my export settings in compressor. Specifically it appears that the FLV quicktime export component is now non-functioning and only produces .FLV's with a very bad flicker in them:
    http://www.vimeo.com/6386852
    password - flash
    In addition and I guess on a tangent I would recommend to any pro editors to do the clean install that so many have suggested for both Snow Leopard and the New FCP Studio as I am already having round tripping issues in color, and have experienced some crashes within Final Cut 7.0
    Now I want to make clear that these are my assumptions before some engineer jumps down my throat. It is entirely possible that these issues are solely mine own and are not common or widespread but from a quick review of these forums I am not sure that is the case. But having the issues I have experienced since upgrading both softwares I made the decision today to initiate a 7 pass erase of the HD and a totally new install to achieve the speed and functionality that keeps me sane and not homicidal.
    From one Devoted FCP editor to any other that will listen.

  • Can Logic Pro and Logic Express coexist on the same computer?

    Hi all,
    I'm a fairly new user to logic. I started with Logic Express to test the water with it before committing to the Logic Pro. I decided I like it enough and have since purchased the Logic Pro upgrade.
    My machine is a MacBook. This machine travels with me, so I am rather concerned about having to maintain a dongle when I am on the move.
    Ideally, I would like to have both Logic Express and Logic Pro coexist on the same machine. That way, when I can reserve the use of Logic Pro for when I am in a stable environment but still be able to use Logic Express when moving around. Granted this would be with reduced functionality, but the peace of mind is worth that to me.
    So does anyone here know if this is possible and can direct me to some instructions on how to accomplish this?
    Thanks!!
    Darth Vanva

    I'd LOVE to be able to enable two simultaneous instances of Logic to accomplish what I want, but AFAIK that's an impossibility (unless a guru-whiz-type like Justin has some ideas on this...).
    OK, here's the deal...
    I have 6 gigs of RAM now. While using Logic I can access up to 3G for samples. If I could somehow run another copy of Logic on the same computer (acting solely as a host for additional plugs, not for sequencing) then I'd gladly buy 2 more gigs of RAM so that the second instance of Logic could address 3G more. I'd still have 2G left for system headroom.
    And there would be an additional (if not hypothetical) benefit to doing this...
    Right now I can run stand-alone instruments outside of Logic (accessed via IAC) in an effort to overcome the 3G limit. But take GPO for example: I can only run 1 instance of it. And, there is no provision for saving any edits or custom made instrument sets in the stand-alone version. So not only would I be limited to 8 individual instrument slots in the lone GPO player, I wouldn't be able to save any custom programming. So much for recall... And of course, EXS is not a stand-alone plug so there's no way I could use it outside of Logic.
    BUT... if I had this second instance of Logic running and treating it as a plug-in host, I'd be able to run multiple copies of plugs (just like I'm used to) and never have to deal with any stand-alone players. And of course by saving its song file I thus save all of my custom programming.
    So yeah, it would be fantastic if I could run a second instance of Logic on the same computer. Theoretically.
    Message was edited by: iSchwartz

  • How to implement Strategy pattern in ABAP Objects?

    Hello,
    I have a problem where I need to implement different algorithms, depending on the type of input. Example: I have to calculate a Present Value, sometimes with payments in advance, sometimes payment in arrear.
    From documentation and to enhance my ABAP Objects skills, I would like to implement the strategy pattern. It sounds the right solution for the problem.
    Hence I need some help in implementing this pattern in OO. I have some basic OO skills, but still learning.
    Has somebody already implemented this pattern in ABAP OO and can give me some input. Or is there any documentation how to implement it?
    Thanks and regards,
    Tapio

    Keshav has already outlined required logic, so let me fulfill his answer with a snippet
    An Interface
    INTERFACE lif_payment.
      METHODS pay CHANGING c_val TYPE p.
    ENDINTERFACE.
    Payment implementations
    CLASS lcl_payment_1 DEFINITION.
      PUBLIC SECTION.
      INTERFACES lif_payment.
      ALIASES pay for lif_payment~pay.
    ENDCLASS.                 
    CLASS lcl_payment_2 DEFINITION.
      PUBLIC SECTION.
      INTERFACES lif_payment.
      ALIASES pay for lif_payment~pay.
    ENDCLASS.                   
    CLASS lcl_payment_1 IMPLEMENTATION.
      METHOD pay.
        "do something with c_val i.e.
        c_val = c_val - 10.
      ENDMETHOD.                   
    ENDCLASS.                  
    CLASS lcl_payment_2 IMPLEMENTATION.
      METHOD pay.
        "do something else with c_val i.e.
        c_val = c_val + 10.
      ENDMETHOD.  
    Main class which uses strategy pattern
    CLASS lcl_main DEFINITION.
      PUBLIC SECTION.
        "during main object creation you pass which payment you want to use for this object
        METHODS constructor IMPORTING ir_payment TYPE REF TO lif_payment.
        "later on you can change this dynamicaly
        METHODS set_payment IMPORTING ir_payment TYPE REF TO lif_payment.
        METHODS show_payment_val.
        METHODS pay.
      PRIVATE SECTION.
        DATA payment_value TYPE p.
        "reference to your interface whcih you will be working with
        "polimorphically
        DATA mr_payment TYPE REF TO lif_payment.
    ENDCLASS.                  
    CLASS lcl_main IMPLEMENTATION.
      METHOD constructor.
        IF ir_payment IS BOUND.
          me->mr_payment = ir_payment.
        ENDIF.
      ENDMETHOD.                  
      METHOD set_payment.
        IF ir_payment IS BOUND.
          me->mr_payment = ir_payment.
        ENDIF.
      ENDMETHOD.                  
      METHOD show_payment_val.
        WRITE /: 'Payment value is now ', me->payment_value.
      ENDMETHOD.                  
      "hide fact that you are using composition to access pay method
      METHOD pay.
        mr_payment->pay( CHANGING c_val = payment_value ).
      ENDMETHOD.                   ENDCLASS.                  
    Client application
    PARAMETERS pa_pay TYPE c. "1 - first payment, 2 - second
    DATA gr_main TYPE REF TO lcl_main.
    DATA gr_payment TYPE REF TO lif_payment.
    START-OF-SELECTION.
      "client application (which uses stategy pattern)
      CASE pa_pay.
        WHEN 1.
          "create first type of payment
          CREATE OBJECT gr_payment TYPE lcl_payment_1.
        WHEN 2.
          "create second type of payment
          CREATE OBJECT gr_payment TYPE lcl_payment_2.
      ENDCASE.
      "pass payment type to main object
      CREATE OBJECT gr_main
        EXPORTING
          ir_payment = gr_payment.
      gr_main->show_payment_val( ).
      "now client doesn't know which object it is working with
      gr_main->pay( ).
      gr_main->show_payment_val( ).
      "you can also use set_payment method to set payment type dynamically
      "client would see no change
      if pa_pay = 1.
        "now create different payment to set it dynamically
        CREATE OBJECT gr_payment TYPE lcl_payment_2.
        gr_main->set_payment( gr_payment ).
        gr_main->pay( ).
        gr_main->show_payment_val( ).
      endif.
    Regads
    Marcin

Maybe you are looking for

  • Transport control program (tp) ended with return code 0200

    Hi Gurus, Please help, we have a fresh system copy of our prod. I already configure new domain controller with one virtual system. it was meant for 2 system lanscape. PRD -> VIR. The problem now is everytime we try to release a config it shows an err

  • Export and Import in Oracle

    I need to export users with tables and data from Oracle 8.0.4 and import into Oracle 8.1.7. But the condition is that we need to retain the Japanese characters. I did this using simple export and import functions but Japanese characters were imported

  • WRT54GS - No Internet when plugged in, but I get Xbox LIVE...

    I have Verizon DSL for Internet, and when I switch the Ethernet cable over to the Router, I have no Internet on my computer, but I have Xbox LIVE...? I'm lost; how do I fix this?

  • Query SQL bulit-in account information

    Dear Expert, Is there any known script to query the sql account (bulit-in) information? espcially for creation date, last logon date, etc? Thanks so much.

  • Can any help on JMS topic timeout issue

    Hi ,           I am getting following error while reading the messages from JMS queue, can any one help me what time out setting i need to increase at console.           Thanks in advance           2005-11-03 05:02:36,839 ERROR ExecuteThread: '2' for