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: plugin architecture using PureMVC - advice needed  (Read 8360 times)
atarsh
Newbie
*
Posts: 4


View Profile Email
« on: July 19, 2010, 08:53:25 »

Hi all,
We have an application built on PureMVC. We allow our users to develop plugins for the application.
As long as the plugins have a view component and a mediator everything works well, but when a plugin doesn't have a view (and therefore no mediator), PureMVC expects you to use commands and proxies.
Our problem emerges when a plugin tries to register a command with a notification that already has a registered command. The plugin command overrides the original command (thus causing the application to stop working - dhaa).
I understand this is how the PureMVC framework works (the override), but I'm trying to think of a way to allow external developers who don't know the internal code to the details to develop view-less plugins.
One way that I notices can work is by misusing the fact that the view component registered with a mediator is typed to generic Object - so I can actually pass my "logic component" there instead and avoid adding it to stage, then use the mediator to communicate with the app just like a view would.
But that is, as I said, misuse :)
So, before I go extending the framework to support multiple commands for each notification - anybody has any ideas?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: July 22, 2010, 07:24:44 »

Are you using MultiCore? If so it wouldn't be a problem, since each core has it's own notification list. For a plugin architecture, I would definitely expect to use MultiCore.

-=Cliff>
Logged
atarsh
Newbie
*
Posts: 4


View Profile Email
« Reply #2 on: July 22, 2010, 08:18:59 »

we are not using the multicore. although I can see how it'll solve the commands problem, we use the notifications cross-application to communicate between the core application and its plugins, so different notification systems will harm us there.
If I understand you correctly, you mean using a different core for each plugin? can the different cores "hear" each other's notifications or are they completely separate?

thanks,

Atar.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: July 22, 2010, 09:15:29 »

You can send messages between cores using pipes and messages. The notifications inside each core are not heard by the other cores.

-=Cliff>
Logged
atarsh
Newbie
*
Posts: 4


View Profile Email
« Reply #4 on: July 25, 2010, 12:13:59 »

if you had to plan the architecture for an application and its plugins, is that how you'd do?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #5 on: July 25, 2010, 01:37:20 »

Absolutely.

-=Cliff>
Logged
atarsh
Newbie
*
Posts: 4


View Profile Email
« Reply #6 on: July 25, 2010, 11:58:57 »

We'll have to consider this, because the project is already live and changes to its core are.. well.. complicated..

thanks a lot, anyway  :)
Logged
Pages: [1]
Print