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 app arch: common logic, specific shell, and widgets...  (Read 11230 times)
grimmwerks
Jr. Member
**
Posts: 14


View Profile Email
« on: February 14, 2011, 01:24:25 »

OK - I'm not sure how best to convey the logic / structure that's being considered for implementation:

We've got

/app/common

-- this app really holds all the common info - ie the constants / notifications used etc
-- communication to the outside world through a socket -- common socket that would receive notifications and send the body or receive data and send notification of what was received.


/app/shell1

/app/shell2

-- these two would hold the basics of what widgets would be loaded in and how the widgets interact, some 'app level' notifications listen/send but on the whole just a shell

/app/widgets1--x
-- each widget would pull in VO from the /app/common/model section and listen to notifications from /app/shell/constants but past that they would respond to messages from the 'outside' (ie via the /app/common connection)


So - does this structure seem ok? Other than /app/common which is puremvc multicore the others are fabrication/multicore and seem fine; I'd assume that the app shell startup would launch the /app/common/controllers.....
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: February 14, 2011, 04:49:40 »

I'd suggest using the Pipes utility, and sending Messages to the other cores rather than retrieving the facade of the given core and sending notifications using it.

Either way using a common library project that the app and module projects allows you to define a protocol (be it notification constants or messages) that keeps your app from knowing too much about the modules or visa-versa.

-=Cliff>
Logged
grimmwerks
Jr. Member
**
Posts: 14


View Profile Email
« Reply #2 on: February 14, 2011, 04:58:32 »

Ah yes - I should've said that we're using Pipes.

I guess I was confused how best to load the controllers from the common project other than the startupCommand from the shell object.
Logged
grimmwerks
Jr. Member
**
Posts: 14


View Profile Email
« Reply #3 on: February 15, 2011, 08:16:14 »

Cliff -

If I've got app/shell1  and it wants to registerCommands of app/common/controller, can I register them directly from (since app/shell1 is fabrication) appShell1StartupCommand?


Or is there something I must do to init app/common/ApplicationFacade (thought there wouldn't be one) as I'm getting the following 'multitonKey not initalized' (note 'app' is 'mix' here).

I call the 'sendNotification' directly after loading the controllers from the 'common' area (and note, common is PureMVC multicore but the 'apps' -- MixClient in this case -- is fabrication).

It seems because it's an AsyncMacroCommand it's confused as to what the multiton key is?  Should I instead be initing the app/common/startupcommand which calls the controllers?


Error: multitonKey for this Notifier not yet initialized!
   at org.puremvc.as3.multicore.patterns.observer::Notifier/get facade()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:89]
   at org.puremvc.as3.multicore.patterns.observer::Notifier/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:59]
   at com.investlab.mix.common.controller::InitJSONRoundTrip/initializeAsyncMacroCommand()[/Users/grimm/Documents/Adobe Flash Builder 4/MIX-server-hugh/src/com/investlab/mix/common/controller/InitJSONRoundTrip.as:16]
   at org.puremvc.as3.multicore.patterns.command::AsyncMacroCommand()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\Utility_AS3_AsyncCommand\src-multicore\org\puremvc\as3\multicore\patterns\command\AsyncMacroCommand.as:61]
   at com.investlab.mix.common.controller::InitJSONRoundTrip()[/Users/grimm/Documents/Adobe Flash Builder 4/MIX-server-hugh/src/com/investlab/mix/common/controller/InitJSONRoundTrip.as:10]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationController/executeCommand()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/core/FabricationController.as:157]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100]
   at org.puremvc.as3.multicore.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:127]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationView/notifyObservers()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/core/FabricationView.as:76]
   at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.facade::FabricationFacade/notifyObservers()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/patterns/facade/FabricationFacade.as:329]
   at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.facade::FabricationFacade/sendNotification()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/patterns/facade/FabricationFacade.as:321]
   at org.puremvc.as3.multicore.patterns.observer::Notifier/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:60]
   at com.investlab.mix.mixclient.controller::MixClientStartupCommand/execute()[/Users/grimm/Documents/Adobe Flash Builder 4/MIX-server-hugh/src/com/investlab/mix/mixclient/controller/MixClientStartupCommand.as:25]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationController/executeCommand()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/core/FabricationController.as:166]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100]
   at org.puremvc.as3.multicore.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:127]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationView/notifyObservers()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/core/FabricationView.as:76]
   at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.facade::FabricationFacade/notifyObservers()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/patterns/facade/FabricationFacade.as:329]
   at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.facade::FabricationFacade/sendNotification()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/patterns/facade/FabricationFacade.as:321]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.facade::FabricationFacade/startup()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/patterns/facade/FabricationFacade.as:228]
   at org.puremvc.as3.multicore.utilities.fabrication.components.fabricator::ApplicationFabricator/startApplication()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/components/fabricator/ApplicationFabricator.as:353]
   at org.puremvc.as3.multicore.utilities.fabrication.components.fabricator::ApplicationFabricator/initializeFabricator()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/components/fabricator/ApplicationFabricator.as:320]
   at org.puremvc.as3.multicore.utilities.fabrication.components.fabricator::ApplicationFabricator/readyEventListener()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/components/fabricator/ApplicationFabricator.as:362]
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at mx.core::UIComponent/dispatchEvent()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:12528]
   at mx.core::UIComponent/set initialized()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1627]
   at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:759]
   at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072]
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #4 on: February 15, 2011, 09:05:23 »

With regard to Fabrication, I don't personally know much about it, so you'll have to post over in that board:

http://forums.puremvc.org/index.php?board=63.0

Cheers,
-=Cliff>
Logged
grimmwerks
Jr. Member
**
Posts: 14


View Profile Email
« Reply #5 on: February 15, 2011, 09:16:43 »

Thanks - will do -- but just curious - if I had a shell that was using controllers in the 'common' app mvc framework, it would be enough to initiate the async controllers directly from the shell application facade rather than the common facade...

strangely enough in testing with a simpleCommand in the common with the fabrication shell core and all's fine; it's just the async that seems to not know who it's facade is...
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #6 on: February 15, 2011, 09:56:53 »

Usually, your common package would be a library, not an app, and thus wouldn't have a facade to be shared. So you could register commands from the common library in any of the cores if it makes sense to run said commands there.


-=Cliff>
Logged
grimmwerks
Jr. Member
**
Posts: 14


View Profile Email
« Reply #7 on: February 15, 2011, 02:35:45 »

Cliff - so sorry to bug you on this but am really having a time of this..

how would I best create a common library then? Just a Flex project as lib?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #8 on: February 20, 2011, 12:42:28 »

Sure, just create a Flex SWC. Are you by chanceh using Flex(Flash) Builder? If so, just create a new Flex Library Project. It will have a src folder where you put your code, and a bin folder where it'll output the swc. When you add your classes, they'll be compiled into the swc. Then you can have your other projects in the workspace include that swc automatically by adding the project to their build paths.

-=Cliff>
Logged
Pages: [1]
Print