View previous topic :: View next topic |
Author |
Message |
vcbc
Joined: 25 Apr 2011 Posts: 15
|
Posted: Tue Mar 05, 2013 10:06 pm Post subject: Injecting an Array/ArrayCollection of managed objects |
|
|
Let's say I have 2 managed PMs. PM1, and PM2.
I want to inject an array (or array collection) containing PM1 and PM2 instances into another object, say MASTER_PM.
How would I do this? Is it possible to do it in the Parsley Config on startup? |
|
Back to top |
|
 |
rattkin
Joined: 10 May 2011 Posts: 154 Location: Poznan, PL
|
Posted: Wed Mar 06, 2013 3:57 pm Post subject: |
|
|
It's possible to have an array collection in managed object and then make it a subject of decoupled databinding (publish), so that it can be received (subscribe) in other managed object - use standard decoupled binding tags/definitions to achieve this.
Your example is quite convoluted though. If by PM you mean presentation model, then you probably should not collect them and publish to somewhere else - this is breaking of encapsulation. PM's serve as middle man but they should not be directly connected to anything besides view (and connection with context is done by messaging and decoupled db).
If you want to pass some objects directly, you can dispatch a message and carry those objects within a message. Then handle the message in a receiver object and obtain them. Or dispatch a message for i.e. command to put those objects in another global managed model, that can then publish these to all interested parties. _________________ Sebastian Zarzycki
Feerie Software |
|
Back to top |
|
 |
|