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: Multicore for AS2? Is that even what I want?  (Read 10641 times)
aLearnerRather
Newbie
*
Posts: 6


View Profile Email
« on: September 09, 2008, 02:24:19 »

Hi,

I'm working on an online social/gaming environment written in AS2 that I am migrating into a PureMVC environment. The main app handles the user management, but there are games and other modules that get loaded at runtime that will need to communicate with the main app--updating the user's score, adding items to his inventory, and so on. I'd like to do the modules and games as PureMVC also, if I can, so that there will be a consistent architecture across all the properties.

How would I handle this in AS2? Is there a good high-level article describing the AS3 Multicore setup that would explain how it works? Is what I am describing even a true multicore application?

Thanks for any advice you can offer,

OK
DAH
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: September 10, 2008, 04:54:23 »

MultiCore is what you want, we just don't have it for AS2 yet.

Pedr, any chance of porting it soon?

-=Cliff>
Logged
aLearnerRather
Newbie
*
Posts: 6


View Profile Email
« Reply #2 on: September 12, 2008, 07:37:25 »

I was looking at the AS3 multicore version and it looks like they're pretty similar. I'll start porting it today; I'll send you a zip when I have something working.
Logged
aaaidan
Newbie
*
Posts: 3


View Profile Email
« Reply #3 on: September 14, 2008, 10:20:40 »

Wow. No messing around there. :)
Logged
aLearnerRather
Newbie
*
Posts: 6


View Profile Email
« Reply #4 on: September 15, 2008, 01:08:52 »

@Cliff,

I'm making some good progress porting Multicore and Pipes at AS2, but I have some architecture related questions--I feel like the weeds are getting taller all around me!

As I understand it, the purpose of Multicore is to allow one PMVC app to load another without their notifications and commands colliding. The purpose of Pipes is to allow two or more PMVC cores to communicate in an ordered way.  The purpose of having multiple cores is to allow each core to have its own self-contained logic, and not need to know anything about other cores, if there are any. Is this correct so far?

I was looking at the PipeWorks demo and trying to understand how the logic is encapsulated. It would appear that Logger and Prattler don't know, or need to know, anything about each other. It also appears that you need to create a sort of meta-application that has references to Logger and Prattler, as well as itself. This meta-app creates the modules, which in turn instantiate the respective facades and run startup() on them, and we're off to the races.

However, it seems that the benefit of encapsulating Logger and Prattler is lost because the shell app has to have all their classes ready when it compiles, in order to work.

In my app, I'll have multiple modules, each represented as a SWF that starts up its own PMVC core, a la ApplicationFacade.getInstance().startup() in the first frame. How do I separate them so that the cores don't require each other's source trees in order to compile?

Thanks very much for any advice you can offer,

David Ham
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #5 on: September 15, 2008, 01:41:20 »

The only reason the classes are all in the same demo is that it would be insane to try and have users download compile and move the modules over for three separate Flex projects as part of the demo. Also the demo completely skirts the issue of loading modules by simply instantiating them. This is because the focus of the demo is on how to use pipes not how to load modules.

In real life, the logger and prattler and the main application would be separate projects, and you would load the modules at runtime. Often you will also have a library project where you place classes that are common to all your cores (a core is the main app or 'shell', or a module/loaded swf). For instance if there are custom messages that one core sends and another must respond to, then both cores need that class, and so it should be in a library both projects use. The shared classes should be in their own package space, and not that of one of the cores.

Hope this helps,
-=Cliff>
Logged
aLearnerRather
Newbie
*
Posts: 6


View Profile Email
« Reply #6 on: September 15, 2008, 02:23:52 »

Thanks very much for the reply. I ad only just gotten my head around the single-core PureMVC; the module aspect was turning me into a pretzel. I think I'm making progress though...
Logged
Pages: [1]
Print