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: Aggregating data from multiple cores  (Read 7243 times)
jrfeenst
Newbie
*
Posts: 1


View Profile Email
« on: July 14, 2009, 02:11:08 »

I am working on a multi-core application which uses Pipes and Fabrication in Flex 3.3. I need to aggregate data from multiple modules and send it to a server. I've been struggling with what the best design is to do this.

The trigger for this aggregation is a proxy method in my main module. My current thoughts are:

1) Use a DO with properties for each piece of data that I need to aggregate. Send out a notification to each module and when the DO has data in each property, fire an event/notification which the aggregation proxy is registered for and send the DO to the server.

2) Try setting up a token ring style Pipes network which passes the DO around the ring to each modules. When it gets back to the originating module, send it to the server. However, I'm under the impression that notifications get dropped by the originating module, so this may not be possible (haven't tried it yet).

3) Setup notifications for each piece of data in the main module so that the modules can send their pieces back to the aggregation proxy.

The first option seems to be my current favorite, however it seems like it goes against the grain of PureMVC.

The second option would be a lot of rewiring of our modules and it might not even work...

The third option just seems messy because I'd be adding more notification constants and probably wouldn't scale well with number of pieces of data.

Are there any examples or preferred patterns for this type of aggregation across modules? Any other thoughts on how to accomplish this? If I had a return value on notifications I'd be set (something like boost/signals Combiner concept would be nice).

- Joel
Logged
serka
Newbie
*
Posts: 9


View Profile Email
« Reply #1 on: July 15, 2009, 04:32:19 »

I do something similar in an app I'm working on. I aggregate the data by using Pipes.

1) The core that's doing the aggregating and sending has pipes to and from all the cores it must aggregate data from (plumbing was done by the shell as the cores were created).

2) The aggregating core sends a message through one pipe to the other cores requesting data.

3) Those other cores respond with the data or a failure through another pipe.

4) The aggregating core can do as it wants when it has all the data it needs.


As a first stab, I would create a single TeeSplit from the aggregating core to all of the other cores and connect all the pipes from the cores to the first with a TeeMerge. If other cores are interested in the data as well, then a different plumbing might be more reasonable.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: July 15, 2009, 11:32:36 »

The token ring approach sounds reasonable to me.

-=Cliff>
Logged
Pages: [1]
Print