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: Do I need to use MultiCore PureMVC version?  (Read 6415 times)
dancantong
Jr. Member
**
Posts: 12


View Profile Email
« on: December 19, 2008, 05:28:18 »

Hi!
I'm working on the architecture for a Flex-PureMVC based project which will have different modules. I wonder if it is really necessary to use the MultiCore version of PureMVC to develop Flex applications with modules instead of Standard one. Couldn't communication between modules and main application be effectuated using simple Notifications without pipelines?
I've implemented a test application with one module and a mediator which handles the module. I've inserted a button in the module which sends a notification when it's pressed to the main application mediator. This seems to work.
Which is the main advantage of using MultiCore approach?

Thanks a lot.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: December 19, 2008, 06:39:49 »

The problem with using the Standard version for modules is that the main actors of the framework are implemented as Singletons; only one of each can exist. Each module needs its own Model, View, Controller and Facade. This means constant names must be coordinated between the modules and the main app (aka shell). A notification name in one module might mean something else in another module. This could be controlled if you are writing all the modules, but never could if third parties were to write modules for your app. Also its not so hot from a security standpoint since all code in all modules has access to everything via the the same Facade.

The MultiCore version uses Multitons instead of Singletons; a map of named instances rather than just one instance. This allows each 'core' to have its own unique set of actors.

Each named set of MVCF actors and their registered Commands, Mediators and Proxies is collectively referred to as a 'core'.

There are two methods for communication between cores: interfaces and pipes.

With interfaces, each module must implement some interface as does the shell. The shell has a reference to each module it loads (or instantiates) and interacts with it in a synchronous fashion by making calls against the module's interface. Likewise, the modules may be given references to the shell and/or any other modules it must collaborate with, and makes interface calls against them. See the Modularity demo for an example of this.

Pipes is the second inter-core communication option. Using the Pipes utility, cores communicate by sending asynchronous messages to each other through pipelines that connect them. The pipelines are constructed of pipes, tees, filters, queues and other pipe fittings that do just what their counterparts in real life plumbing do. See the Pipeworks demo for an example of this.

You can mix and match the two inter-core communication methods in the sam application.

You are *not* advised to attempt modular development in the Standard version, it is unsuitable for the task.   

-=Cliff>
Logged
dancantong
Jr. Member
**
Posts: 12


View Profile Email
« Reply #2 on: December 19, 2008, 03:29:35 »

Ok, I understand. I will have a look at those samples.

Thank you for your help. ;)
Logged
Pages: [1]
Print