Spicefactory Forum Index Spicefactory
Forum Archive
 
 SearchSearch    Log inLog in 

Injecting an Array/ArrayCollection of managed objects

 
Post new topic   Reply to topic    Spicefactory Forum Index -> Spicefactory
View previous topic :: View next topic  
Author Message
vcbc



Joined: 25 Apr 2011
Posts: 15

PostPosted: Tue Mar 05, 2013 10:06 pm    Post subject: Injecting an Array/ArrayCollection of managed objects Reply with quote

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
View user's profile Send private message
rattkin



Joined: 10 May 2011
Posts: 154
Location: Poznan, PL

PostPosted: Wed Mar 06, 2013 3:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Spicefactory Forum Index -> Spicefactory All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group