Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: cross-referencing proxies  (Read 6894 times)
Steve
Newbie
*
Posts: 6


View Profile Email
« on: July 23, 2009, 02:41:38 »

I have 3 proxies running at startup making remote service calls, and once all 3 are returned, I need to cross reference them. By that I mean the following:
The 'interviews' data is an array with each interview having a one-to-many reference to a fundID.
The 'funds' data contains a one-to-many reference to a groupID with each fund having a fundID.
The third data set is 'groups' with each group having a groupID.

After the cross-referencing is done, I would, for example, be able to reference the name of a group associated with a particular interview thus: interview.fund.group.name

I obviously cannot do the cross-referencing until all 3 sets of data are available. How do I flag when all 3 data sets are available within pureMVC?

The only way I can think of is for each proxy to send a 'data loaded' notification which is responded to by a data-checking command. This would retrieve references to the 3 proxies and query them for whether the data is available. If it is, it then either performs the cross-referencing or send a notification which is responded to by a cross-referencing command.

Am I close with this or is there a much nicer / more correct way of doing it within pureMVC?

Many thanks for any help.
Logged
Steve
Newbie
*
Posts: 6


View Profile Email
« Reply #1 on: July 23, 2009, 03:08:40 »

Just a thought - I guess an alternative way of doing this would be to have one 'SiteDataProxy' which uses delegates to do each of the 3 remote service calls. The test for all data being loaded would be encapsulated into the SiteDataProxy which then sends a notification only once all data has loaded and been cross-referenced.

In this case my question would be - are the delegates also Proxy subclasses? Is it OK to have references to other proxies inside a proxy?
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #2 on: July 23, 2009, 03:57:24 »

The StartupManager utility might be relevant - plus the associated demo Startup As Ordered - to do with loading data records of different types, in a prescribed sequence, so that one type does not commence loading until all the types it depends on have been loaded.
----Philip 
Logged
Pages: [1]
Print