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));

Similar Messages

  • Pesky louse 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));

  • Loosely coupled systems

    Hi All,
    Sorry to ask this question.but i need exact definition  and adavantage of loosely coupled system to undersatnd client the usage of XI in this concept.
    One more question same like above.
    They are asking interdependency of exchanges , when exists and if not implemented through XI may cause error handling very difficult, how can u achive this in XI.
    Though i have some view on the above questions I'm expecting live definitions and usage of above advantages.
    Regards,
    venu.

    Hi Venu,
    Its better if you think of the concept of loosely coupled systems in a "Before" & "After" kind of approach. To make it simple,
    1. System A & System B are a part of your integration landscape.
    2. Before introduction of XI (for that matter any similar functionality product), these system integrate with each other making peer to peer connections.Say System A copies a file abc.txt into a folder of System B and vice versa for response messages if any.
    3. After introduction of XI, you now leverage onto the integration capabilities of XI. So system A which had to handle copying of file abc.txt to some folder of System B now just has to ensure that it makes the file available to XI which in turn will connect to System B and send appropriate data in desired format.
    In this way the two systems which were tightly integrated with each other now are loosely coupled with each other.XI can also take care of any specific requirements of polling periodically , format conversion and many other.
    Rgds,
    Amol

  • 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

  • Java data types are tightly coupled or loosely coupled ?

    java data types are tightly coupled or loosely coupled ?

    Is this another interview question? If so, the answer you should have given is, "You, sir, have been smoking too much crack."

  • 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

  • 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.

  • 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

  • Coupla questions from a newby

    Ive had my iphone for only one week, so still have my 'L' plates. Have a couple of questions:
    1. Is the only way to correct a wrong entry of phone number in the 'new message' screen for text message by back spacing (using the 'x' button in bottom right) or can I 'wander' over the number to change specific numbers?
    2. If I want to purchase Applications, do I have to open an account in iTunes? If so, some applications are only 99c, is there a min purchase when using an iTunes account?
    Many thanks in advance.
    JohnC

    The applications that come with the phone can't be deleted. You can move them to another page so you don't have to see them. Just press and hold the icon until they start to "wiggle". Then slide them to the side until they go off the page onto another page. Their can be a total of 9 pages. While the icons are wriggling, any that you have added (apps from the app store or web clips) will have a white circled X at the top left. Tap the X to delete these. Press the home button when you are finished arranging.

  • Coupla questions after updating to Snow Leopard

    Hi folks.  I just upgraded from Tiger 10.4.11 to Snow Leopard 10.6.8, and boy, do I have some questions!
    1. Are there any rules of thumb on reducing the probability that this OS X 10.6.8 will lock up?  For example, it seems that if I'm getting the computer out of "sleep" mode or even just using the keyboard or clicking the mouse after a few minutes of inactivity, it locks up if I hit more than one keystroke or click the mouse more than one time before the internal hard drive finishes whizzing.  I'm thinking that I need to get into the habit of pressing one keystroke, listening to hear whether the hard drive starts up, and if so, waiting until it settles down before making any more keystrokes or using the mouse.  Any other tips?
    2. What is the keyboard alternative to using the pulldown menu for force quit?  Unlike my experience with Tiger, if the rainbow is spinning, this new OS won't allow me to use the cursor to pull down the apple menu to get to the force quit utility.
    3. When my computer's locked up with the spinning rainbow, and the force-quit utility isn't working is there any way to get it to unlock, other than disconnecting it from the power source?
    4. How bad is it to disconnect the computer from electrical power when it's locked up but still running?
    5. When I was loading the OS, I thought there was a tutorial for Snow Leopard, but I can't figure out how to get back to it.  Can you tell me how I get it to run?
    6. I own an external HD for backup.  Please tell me that Snow Leopard includes a backup utility program, and how to use it.
    7. Final question for now--does Lion perform any better than Snow Leopard?  Not sure whether updating to Lion would make things better, worse, or no change (other than my wallet).
    Thanks for your help.
    Regards,
    John

    Command + option + escape brings up the force quit window.  Note that odds are that if you have a spinning cursor you won't be able to use the keyboard either.
    3. When my computer's locked up with the spinning rainbow, and the force-quit utility isn't working is there any way to get it to unlock, other than disconnecting it from the power source?
    4. How bad is it to disconnect the computer from electrical power when it's locked up but still running?
    Pushing on the power button for a bout 5 seconds is basically the moral equivalent of "pulling the plug".  If it's the only way "out" then it's the only way out!  What's the choice? 
    6. I own an external HD for backup.  Please tell me that Snow Leopard includes a backup utility program, and how to use it.
    As above, I recommend Carbon Copy Cloner or Super Duper.
    7. Final question for now--does Lion perform any better than Snow Leopard?  Not sure whether updating to Lion would make things better, worse, or no change (other than my wallet)
    Beauty is in the eye of the beholder.  Same for usefulness and "better".  In my opinion it is a schizophrenic OS that wants to be the old OSX cross bread with a IPad.  Basically dumbed down.  It also doesn't run ppc code since there is no Rosetta.  IMO stay clear of it.  Play with it in the Apple Store to get a taste.
    Please, whoever is reading this, lit's not start a religious war here. This is my opinion of Lion (and many others).  But if you like Lion fine with me.

  • Loose coupling among objects within oracle schema

    I am building an information service that manages Suppliers. The suppliers are used by our billing system, tender system and sales system. Though 60% of the attributes of supplier are unique to each system, there are still 40% attributes of Supplier that are shared across the systems.
    My objective is to build a flexible system, so that change to one individual system's data, should not impact other systems. For example, if i need to make certain tables offline for upgrading them, it should not impact rest of the systems that need supplier information. What is the best way of achieving this? Should all the different context specific attributes live in one schema, but deployed on different table spaces? Also, the read and update may happen more for one set of attributes than the other. How should i logically represent them via one model, but deploy them in such a fashion that they can evolve independently?
    Thank you.

    Reports - All reports - Data dictionary reports - Database administration - All tables - All tables, and specify B as schema name.
    Have fun,
    K.

Maybe you are looking for

  • Anmeldung ist auf diesem Computer oder Gerät nicht möglich.

    Hallo, wir haben mehrere Abonnements bei Adobe (1x Vollabo, 1x InDesign) über den gleichen Account/ Adobe-ID. Jetzt wollten wir InDesign auf einem Desktop und einem Laptop (beides der gleiche Nutzer (InDesign-Abo)) installieren und einmal InDesign be

  • How do I add an MP3 Soundtrack to my animation in Adobe Edge?

    Sorry if this has been discussed, I can't find a way to search the discussions I simply want to include an MP3 soundtrack to run during my animation - import does not allow MP# files to be imported. Thank you!

  • Sound breaking up after installing Leopard

    I just installed Leopard on my G5, updated the OS to 10.5.4. But I noticed that under both 10.5.1 and 10.5.4, sound "streamed" via my browser--demo'ing cuts off eMusic for instance--break up. I'd post to the Safari topic, but I've confirmed this phen

  • Help making a 3D cut sphere in Illustrator?

    Hello! So I'm a novice at making 3D objects in Illustrator. I'm attempting to make a cut sphere in Illustrator. I'm not sure if what I want to achieve is best done through pen tool and gradients or 3D revolve. Here are some screenshots of my attemps

  • Garbled arabic text in itunes

    My arabic text showed fine when I was using iTunes in Windows. However, on my MacBook the arabic titles of songs are garbled and in strange characters.