Using a Singleton Mediator to provide loose coupling

I need to discuss the pros and cons of using a singleton mediator to provide loose coupling between component implementation classes.
Suppose you are building a SE or a BC where an endpoint is defined upon a SU deployment. In this scenario, you will end up finding out that the Component, ComponentLifeCycle and ServiceUnitManager implementations should know each others instances. I can figure out these solutions:
-     Use tight coupling
-     The component implements the three interfaces (or two of them and associates the third)
-     Use a singleton mediator to hold the instances
-     Use a third party solution, like Spring's ApplicationContext and ApplicationContextAware contracts
-     Some other solution I didn't think of (the scenario has to be more specific)
Assuming the scenario as described above, I prefer the third solution.
I appreciate your opinions.
Hossam Karim

When you evaluate the JBI implementations available, you will notice that each one has built a less abstraction layer over the JBI component contracts in order to simplify its subsequent tasks. As a component builder, you would either reuse one of these layers and get tight with a specific implementation, or start writing your own.
I recently proposed a simple framework to my team; you can find a class diagram here (http://www.gaiati.com/products/emee/framework.png), it has the following elements:
�     AbstractBootstrapAdapter: Simple adapter for the Bootstrap interface
�     ComponentApplicationContext: Provides a Spring based Application context for this component, the context beans should be loaded upon component initialization. An instance of this class will be available to all classes or interfaces that extend the ApplicationContextAware Spring interface. All classes and interfaces on the previous diagram that associate a ComponentApplicationContext instance (applicationContext) implement the ApplicationContextAware interface. One exception is the AbstractComponentAdapter class, because it actually creates the instance.
�     AbstractComponentAdapter: Adapter for the component and lifecycle contracts. Upon initialization, this class creates a ComponentApplicationContext instance, and uses the beans to configure itself, the class recognizes other framework contracts and able to communicate with them.
�     AbstractMessageListener: Consumes this component's DeliveryChannel message exchanges, and fires a handling trigger.
�     DeployedEndpoint: Represents an endpoint that was deployed using a SU
�     DeployedEndpointConfiguration: Holds the configuration needed by a DeployedEndpoint instance
�     DeployedEndpointTarget: Represents the target JBI specific address that a DeployedEndpoint instance should route the messages to.
�     GenericMessageListener: Handles the trigger fired by the AbstractMessageListener, delegating the work to an instance of the DeployedEndpoint interface
�     GenericServiceUnitManager: Handles GenericServiceUnit instances
�     GenericServiceUnit: Acts as a proxy and encapsulates a DeployedEndpoint instance
�     AbstractDeployedEndpointFactory: An abstract factory for creating DeployedEndpoint instances using DeployedEndpointConfiguration instances
Yes, I ended up using Spring, and you are right, it might not be appropriate to attempt to separate the interfaces, may be I misunderstood or was mislead by Open-ESB implementation of the SOAP and file binding components.
It is true sometimes you can have "personal taste", but most important is to achieve best practice.
Finally, I hope the specification in its next versions, would provide us with a best practice framework or proposal, instead of so much choices.
Hossam Karim

Similar Messages

  • Attemp to build loosely coupled WS using xsd:any & xsd:anyType?

    Dear All,
    i want to write a loosely coupled web service that allow
    the server to evolve independently to the client. (main
    purpose is to extend the service by adding more properties
    in the request / response message)
    i want to achieve the loosely coupled goal by adding
    xsd:any or xsd:anyType to the request / response messages
    (i.e. wsdl ComplexType). (just follow the normal XML
    guideline).
    i have try to write simple program with xsd:any (which
    mapped to SOAPElement in JAX-RPC). And the result seems
    good and can achieve my goal. ( i can consume the service
    in java and .net without problem).
    but later, i read some article, in the web, (like this: http://www.ibm.com/developerworks/xml/library/ws-tip-xsdcaution.html)
    that clams it is better to use xsd:anyType instead of
    xsd:any (as anyType is mapped to SOAPElement or java
    object if server/client can deserialize it).
    as far as i know, the support of xsd:anyType is not standardized / madatory.
    could anyone tell me your comment about using xsd:anyType or xsd:any?
    how about the support of xsd:anyType across different platform / tools?
    xsd:anyAttribute seems not supported by jax-rpc, could you please comment on using this element in the wsdl? good or bad?
    oracle will map this element to an oracle proprietary java object.
    am i choosing the right way to achieve loosely-coupled WS? any other way?
    some article claims to send request as xml doc. but it
    seems that is not very convenient to server and client as
    both sides need to write code for serialization /
    deserialization.
    why not use the existing automatic XML <--> java object provided by the jax-rpc standard?
    Thank you very much
    Message was edited by:
    lsp

    Hello,
    Is your question related to very specific element of your message or for the complete message.
    Using any/anyType even if powerful could be sometimes complex for Web Service Client developer to handle since the Java object (SOAPElement or Object) is not typed so doing late binding of schema force people to do the mapping themself any.
    So before choosing this in a wide scope on your project think also to its impact for end user/developers, and I think you are on the good path, as you said anyType will recognize the object.
    I am inviting you to also look at the Oracle Web Services Interoperability documentation.
    and this article from SUN: Interoperability With Patterns and Strategies for Document-Based Web Services
    Regards
    Tugdual Grall

  • Tightly and Loosely coupled scenarios

    Hi Experts,
    Could you please provide a example for Tightly coupled and Loosely coupled scenarios from SAP Platform?
    How to do the below scenarios from SAP platform?
    1. Tightly coupled (Non-SOA):
        Business Services : I have to create RPC encoded style webservices.
        Business Process : I have to call other platform RPC encoded style webservices (More than 2 webservices).
    2. Loosley coupled (SOA):
        Business Service : I have to create Document literal style webserivces
        Business Process : I have to call other platform Document literal style webservices ( More than 2 webservices)
    Please provide the input to do the above scenarios from SAP platform and please inform me which tool/component I have to use do the scenarios.
    Thanks & Regards
    Sara

    Hi Sara,
    Can you please elaborate your question in detail .
    1) Web Services are always examples of loosely couples architecture, either its document style or RPC style and whether you are creating WS or consuming WS.
    Tightly coupled architectures were those whose business logic layer and presentation layer were tightly coupled and reusability or scalability was a problem
    If you have user interfaces involved in your business process, then you should go for CAF( Composite Application Framework) to define a business process using VC, WebDynPro or Adobe Forms as UI.
    If it doesn't involve any user interaction, then you can go for ccBPM of Netweaver-PI to automate the process.
    Regards,
    Piyush

  • Tightly coupled and Loosely coupled scenarios

    Hi Experts,
    Could you please provide a example for Tightly coupled and Loosely coupled scenarios from SAP Platform?
    How to do the below scenarios from SAP platform?
    1. Tightly coupled (Non-SOA):
    Business Services : I have to create RPC encoded style webservices.
    Business Process : I have to call other platform RPC encoded style webservices (More than 2 webservices).
    2. Loosley coupled (SOA):
    Business Service : I have to create Document literal style webserivces
    Business Process : I have to call other platform Document literal style webservices ( More than 2 webservices)
    Please provide the input to do the above scenarios from SAP platform and please inform me which tool/component I have to use do the scenarios.
    Thanks & Regards
    Sara

    Hi Sara,
    Can you please elaborate your question in detail .
    1) Web Services are always examples of loosely couples architecture, either its document style or RPC style and whether you are creating WS or consuming WS.
    Tightly coupled architectures were those whose business logic layer and presentation layer were tightly coupled and reusability or scalability was a problem
    If you have user interfaces involved in your business process, then you should go for CAF( Composite Application Framework) to define a business process using VC, WebDynPro or Adobe Forms as UI.
    If it doesn't involve any user interaction, then you can go for ccBPM of Netweaver-PI to automate the process.
    Regards,
    Piyush

  • Pesky loose coupling question

    Hey guys,
    I have 3 files: main.mxml, registration.mxml, and
    update.mxml. The registration is a custom canvas component with a
    datagrid, and the update is a popup activated by clicking the
    datagrid. I understand how to dispatch custom events, but I'm
    having trouble dispatching from popup back to main.mxml where my
    remote code is located. I can successfully dispatch objects with a
    custom event from reg component to main. What am I doing wrong?
    Should I just add a remote command in the registration component
    and run a function in the registration? Doesn't seem like loose
    coupling to me?

    If your registration component is instantiated in main and
    you dispatch an event that bubbles from registration to main, then
    bubbling works. But forget about bubbling when dispatching an event
    from a popup to any other component. You can do the following:
    If you use a model (with Cairngorm, PureMVC ... or simply
    Singleton), you can have an object in your model that extends
    EventDispatcher and serves as a message target.
    package com.mycompany.core.model
    import flash.events.EventDispatcher;
    // This class only serves as the target for messages that
    concern objects that are not
    // in the display list or that are in the display list but
    cannot be reached by event bubbling
    public class MessageTarget extends EventDispatcher
    public function MessageTarget()
    In your model:
    // Message target
    public var messageTarget:MessageTarget = new
    MessageTarget();
    In any component interested in some messages (e.g column
    visibility) dispatched on the message target :
    // Add event listener for column visibility change
    this.model.messageTarget.addEventListener(ColumnVisibilityChangedEvent.COLUMN_VISIBILITY_ CHANGED,
    this.onColumnVisibilityChanged);
    Then, you can dispatch an event from anywhere that can be
    listened to anywhere:
    // Send Column Visibility Changed event
    this.model.messageTarget.dispatchEvent(
    new
    ColumnVisibilityChangedEvent(ColumnVisibilityChangedEvent.COLUMN_VISIBILITY_CHANGED,
    false, false));

  • Loose coupling transport  in PI 7.0

    Hi,
      We are trying to implemet OTO.I am tring to do a loose coupling transport in PI 7.0 from DEV to QUA.  I have created one workbench request in se09 and have exported my IR object. I can see my exported IR object in IR>Tools>Find transports.  But Open transport organiser is disabled. Can anyone tell me why is it disabled and how to resolved it?
    I feel configuration is not proper. Can any one tell me, where the configuration  would  be wrong.
    Please also send me step by step procedures (links) for implementing OTO
    Thanks,
    Arivarasu S.

    Hi,
    PI scenario is just used for XI
    Regards,
    michal

  • Mapping Template : Loosely Coupled or hard Coupled

    Hi All
                I m using mapping template for graphical mappng. I have the following doubts:-
         1. Whether the mapping template is loosely coupled or tight coupled , i mean whether it picks the template at run time or the fields are filled one time only.
         2. If we use the mapping template and afterwards do some changes in the mapping template then whether the changes gets reflected in the mapping program or not?
          3. Can we change some fields of the mapping templates used in the mapping program after impoting that template? ( Here changes means changes in the mapping program )
         Regards
             Amit

    hi,
    >>  Whether the mapping template is loosely coupled or tight coupled , i mean whether it picks the template at run time or the fields are filled one time only.
    i dnt know whether this is a standard term or not but in these terms i think it is " tight" coupled.
    >>  If we use the mapping template and afterwards do some changes in the mapping template then whether the changes gets reflected in the mapping program or not?
    No changes dont get reflected automatically if u change the template after assigning it in a mapping program.
    >> Can we change some fields of the mapping templates used in the mapping program after impoting that template
    It becomes a complete separate mapping program altogether even if u use a template. template is only to save ur time of designing mapping it does not contain references at run time. u can change this mapping program at anytime u want.
    [reward if helpful]
    regards,
    latika.

  • How to create loosely coupled transaction branches with DBMS_XA ?

    Hello,
    I use DBMS_XA to start several sessions in the same database instance participating a global transactions. The local transaction branches are tightly coupled.
    Do you know a way (Oracle 11.2) for the branches to be loosely coupled by using dbms_xa in one-only instance ?
    Best Regards,
    Gregory

    For non XA datasource create a JDBC Connection with data source class
    oracle.jdbc.pool.OracleDataSource
    For xa datasource create a JDBC connection with data source class
    oracle.jdbc.xa.client.OracleXADataSource

  • Are WTC transactions loosely coupled?

    Hello,
    I am looking for a confirmation that XA transactions between Tuxedo and WLS (using WTC) are only loosely coupled.
    I cannot find much details on how WTC handles transactions from and to Tuxedo.
    On the Tuxedo side, it is stated clearly that transactions accross domains are loosely coupled. Since Tuxedo and WLS instances are in different domains, I am assuming that transactions between Tuxedo and WLS have the same constraints as Tuxedo inter-domain transactions. Unless WTC were to optimize such transactions.
    The specific challenge we face is as follows (using Tuxedo 10.0, WLS 10.3, Oracle 11g):
    1) A Tuxedo Corba App starts a transaction and does some work.
    2) The Tuxedo Corba App calls an EJB service in WLS.
    3) The EJB service does some work and updates a record in the Oracle DB.
    4) The EJB service returns control to the Tuxedo Corba App.
    5) The Tuxedo Corba App selects the same record that the EJB updated.
    6) The Tuxedo Corba App does some more work, and the commits the transaction.
    The problem is that in step (5) we don't see the update that the EJB made. If we replace the select in step (5) with an update, the update times out because the record is locked. However, the global transaction commits or rolls back correctly on both sides. This indicates that the transaction branches in Tuxedo and WLS are loosely coupled.
    Roger

    Across Tuxedo /Domain the transaction is loosely coupled. WTC is subjected to the same limitation. So you are correct, those XA transactions between Tuxedo and WLS are loosely coupled.

  • How can I use more than one Data Provider in my web Apps

    I am trying to use two different data provider in my web apps to run two different queries from the same table ,the data provider A is working correctly but when I attempt to run data provider B ,It display an error page ,here is the error message : Exception Details :javax.servlet.ServletEx ception
    java.lang.RuntimeException: java.sql.SQLException : Cannot connect .Both dataSourceName and url properties are null.

    Hi,
    You can use more than one data provider in your application. However if you have defined a dataprovider for a particular table already, and wish to bind a component, select the component and use its context menu to Bind to Data...

  • Can we use more than one Help Provider class in a same project in ADF11g

    Hi All,
    There are two help providers i want to use .They are "ResourceBundleHelpProvider","OHW Help Provider"
    In adf-settings.xml file
    <help-provider>
    <help-provider-class>oracle.adf.view.rich.help.ResourceBundleHelpProvider</help-provider-class>
    <property>
    <property-name>baseName</property-name>
    <value>com.symmetry.dashboard.panels.Help</value>
    </property>
    </help-provider>
    if try to register both help providers confliction occurs. Is it possible to register and use more than one help provider.?
    Thanks in advance.:)

    Thanks Frank,
    In adf-settings.xml file
    <help-provider>
    <help-provider-class>oracle.adf.view.rich.help.ResourceBundleHelpProvider</help-provider-class>
    <property>
    <property-name>baseName</property-name>
    <value>com.symmetry.dashboard.panels.Help</value>
    </property>
    </help-provider>
    <help-provider prefix="RB_">
    <help-provider-class>oracle.help.web.rich.helpProvider.OHWHelpProvider</help-provider-class>
    <property>
    <property-name>ohwConfigFileURL</property-name>
    <value>/myHelpset/config.xml</value>
    </property>
    <property>
    <property-name>baseURI</property-name>
    <value>http://127.0.0.1:7101/Dashboard_workflow/myHelpset/%3c/value>
    </property>
    </help-provider>
    I differentiated the help providers with the "prefix" attribute in the <help-provider> tag. So now confliction is not occuring between those.
    I used this prefix in the "helpTopicId" property of the adf components like "input text box" . I got the result. :)

  • My mac's launchpad is working but i am not able to use the apps that are provided in the launchpad

    my mac's launchpad is working but i am not able to use the apps that are provided in the launchpad

    Well, everything that you have bought with her Apple ID prior to getting your own Apple ID is forever hers. Apple will not transfer content from one ID to another. But in the case of the Mac, contact iTunes Customer Service and request that they send your issue to the Account Security Team and ask that the Mac be released form your mother's account so you may register it with your account. Then you can accept the iLife apps into your account for any future updates.
    iTunes Support -
    http://www.apple.com/support/itunes/

  • I have a new iPad. I am using Comcast as my email provider but when I send a message, it pulls up the facebook email addresses for my  contacts  instead of the addresses stored in my comcast account.  How can I get rid of the Facebook email addresses? The

    I have a new iPad. I am using Comcast as my email provider but when I send a message, it pulls up the facebook email addresses for my  contacts  instead of the addresses stored in my comcast account.  How can I get rid of the Facebook email addresses? The comcast addresses are stored in the comcast (xfinity) app.  I do not use the "mail" or "contacts" apps ....I go straight to comcast (xfinity).  I wish I could start over!!!  thanks.
    iPad

    I could be wrong, but it sounds like Facebook imported to your contacts.  I have the Xfinity app on my new ipad, too, but none of my stored contacts from the online version are showing, only what I manually entered into the iPads contacts are there.  When I did add the FB app, I did not grant it permission to push and pull from my ipad (not a fan of FB knowing every detail about me), so that may be where our difference lies.  You could try to open the app and change your privacy settings, or delete it and then reinstall without granting permissions to integrate.
    I'm sure someone here with a lot more knowledge then me can probably diagnose your issue better, though.  Good luck!

  • How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file?

    How can we send only one message to a WCF service at a time? How we can limit the number of concurrent calls to a WCF service without use the Singleton pattern or without do the change in BizTalk Configuration file? Can we do it by Host throttling?

    Hi Pawan,
    You need to use WCF-Custom adapter and add the ServiceThrottlingBehavior service behavior to a WCF-Custom Locations.
    ServiceThrottlingBehavior.MaxConcurrentCalls - Gets or sets a value that specifies the maximum number of messages actively processing across a ServiceHost. The MaxConcurrentCalls property specifies the maximum number of messages actively
    processing across a ServiceHost object. Each channel can have one pending message that does not count against the value of MaxConcurrentCalls until WCF begins to process it.
    Follow MSDN-
    http://msdn.microsoft.com/en-us/library/ee377035%28BTS.10%29.aspx
    http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentcalls.aspx
    I hope this helps.
    Rachit
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Since my last firefox update, I have been unable to type an email - the text box does not appear when I press 'reply' , or press 'compose'. The email provider is '123-reg.co.uk. I have been using both firefox and the provider ['webfusion Ltd/webmail123] s

    Hello. Since my last firefox update, I have been unable to type an email - the box within which one would usually type does not appear when I press 'reply' to a received email, or press 'compose'. The email provider is '123-reg.co.uk. I have been using both firefox and the provider ['webfusion Ltd/webmail123] successfully for well over a year. The provider says it is a browser problem. I can still add an attachment to the email header, which successfully can be sent, but the recipient gets my standard email 'signature' with font messages and the attachment. Can anyone help? My email addresses are [email protected] [this is the one with the issue] and [email protected] in English
    == today

    My daughter has had her Razr for about 9 months now.  About two weeks ago she picked up her phone in the morning on her way to school when she noticed two cracks, both starting at the camera lens. One goes completely to the bottom and the other goes sharply to the side. She has never dropped it and me and my husband went over it with a fine tooth comb. We looked under a magnifying glass and could no find any reason for the glass to crack. Not one ding, scratch or bang. Our daughter really takes good care of her stuff, but we still wanted to make sure before we sent it in for repairs. Well we did and we got a reply from Motorola with a picture of the cracks saying this was customer abuse and that it is not covered under warranty. Even though they did not find any physical damage to back it up. Well I e-mailed them back and told them I did a little research and found pages of people having the same problems. Well I did not hear from them until I received a notice from Fed Ex that they were sending the phone back. NOT FIXED!!! I went to look up why and guess what there is no case open any more for the phone. It has been wiped clean. I put in the RMA # it comes back not found, I put in the ID #, the SN# and all comes back not found. Yet a day earlier all the info was there. I know there is a lot more people like me and all of you, but they just don't want to be bothered so they pay to have it fix, just to have it do it again. Unless they have found the problem and only fixing it on a customer pay only set up. I am furious and will not be recommending this phone to anyone. And to think I was considering this phone for my next up grade! NOT!!!!

Maybe you are looking for

  • Access number inoperative

    Hello my Skype acces is not working I also found strange phone number authorization on my AUTHORIZED list Changing PASSWORD - is it going to change things? Improve?

  • No sound in my ipod videos

    i read the previous post, and i can understand u not helping with stolen music, but i have simple videos taken with my digital camera of my friends and i...and when i convert them with quicktime pro 7, theres no sound! whats up with that?! 60 gig vid

  • Best way to export from FCP for website

    I've been reading around about this and am not getting a clear idea of what to do... I have some short sequences in FCP (longest is 2 minutes) that I want to post individually on my new website (that I'm just learning about). I want to export them in

  • Need urgent information

    Hi All, I have heard somewhere that from 11gR2 , Oracle Clusterware TOC the node when RAC Interconnect fail on that node. Prior to 11gR2 Oracle cluster used to just halt the RAC DB instance on that node. Is it true. In case of 11gR2 with multiple dat

  • Connexion bureau à distance a cessé de fonctionner

    Signature du problème :   Nom d'événement de problème: APPCRASH   Nom de l'application: mstsc.exe   Version de l'application: 6.3.9600.16415   Horodatage de l'application: 524b4de4   Nom du module par défaut: BandwidthGuard.dll   Version du module pa