Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Injecting by ID is not considerer to be good practice because you create a name-based dependency. Change the name, or make a typo, and your application breaks and it's hard to debug that. </p> <p>So as a general rule you should try to avoid it. The Parsley docs <a href="http://www.spicefactory.org/parsley/docs/2.1/manual/injection.php#tags" rel="nofollow">explain how to do this</a>. I'll just add a simple example to show you how you'd use that technique with your multiple RemoteObjects.</p> <pre><code>&lt;fx:Object xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:p="http://www.spicefactory.org/parsley"&gt; &lt;fx:Script&gt; import path.to.service.GenBusDelegate; import path.to.service.KarBusDelegate; &lt;/fx:Script&gt; &lt;fx:Declarations&gt; &lt;fx:String id="gateway"&gt;http://localhost:8080/ClinASM/messagebroker/amf&lt;/fx:String&gt; &lt;s:RemoteObject id="genBus" destination="genBus" endpoint="{gateway}" /&gt; &lt;s:RemoteObject id="karBus" destination="karBus" endpoint="{gateway}" /&gt; &lt;p:Object type="{GenBusDelegate}"&gt; &lt;p:ConstructorArgs&gt; &lt;p:ObjectRef idRef="genBus" /&gt; &lt;/p:ConstructorArgs&gt; &lt;/p:Object&gt; &lt;p:Object type="{KarBusDelegate}"&gt; &lt;p:ConstructorArgs&gt; &lt;p:ObjectRef idRef="karBus" /&gt; &lt;/p:ConstructorArgs&gt; &lt;/p:Object&gt; &lt;/fx:Declarations&gt; &lt;/fx:Object&gt; </code></pre> <p>or if you don't want to use constructor arguments:</p> <pre><code> &lt;p:Object type="{GenBusDelegate}"&gt; &lt;Property name="remoteObject" idRef="genBus"/&gt; &lt;/p:Object&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload