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: Shared core across multiple applications  (Read 9538 times)
Joel Hooks
Courseware Beta
Sr. Member
***
Posts: 146


baby steps

 - 46288188  - passport@provinsal.com  - joeltuff
View Profile WWW Email
« on: September 27, 2008, 10:01:14 »

I am building a toolset that consists of a web frontend and a management utility for the owner to update the web front end and do various tasks. The web bit is Flex and the admin tool is an AIR application. Obviously they share a common data model, and this is the exact use I believe PureMVC is built for.

Right now I am 'planning' on using the core bits as a shared library, but I am wondering if this would be a good place to use a module. I don't know how to really go about it though, the application shell loads the core module, and then loads the appropriate view module? Would I have a base view module that first loads the core and then initiates itself after it receives a particular notification? Or is it better to just keep a library project and use the shared SWC?

I suppose it is all the same thing when it gets down to it, eh?
Logged

http://joelhooks.com - my ramblings about developing with actionscript and python using pureMVC and django respectively.
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: September 28, 2008, 05:22:19 »

Its the same thing from a loading perspective, but way different otherwise.
You can move all of your model interaction into a Flex Module and load it as a separate core, then you have the problem of how to communicate with it. If its just the main app and this service adapter module then you can put a Proxy in charge of it, expose methods on it and send events from it, etc. Treat the rest of the program like a standard version PureMVC app.

Or you can use Pipes to plumb this thing to the main app and any other modules that need to talk to it and then send it messages.

The former approach isn't much different than what you're used to. But the latter is asynchronous comm between modules, and breaks down to protocol. What messages get sent to it, and what messages get returned from it.

That's the modular route. It is certainly the most extreme separation of the model that you can get. Total black box. You'll still need a common library though, for any custom message types and VOs that you share between the module and any other cores.

On the other hand, there's nothing wrong with using the standard version and simply putting all your common stuff in a swc particularly if its just you doing the dev. 

The modular approach becomes more attractive as the size of the app and/or number of developers increases, or if you want to outsource part of the app.

-=Cliff>
Logged
Joel Hooks
Courseware Beta
Sr. Member
***
Posts: 146


baby steps

 - 46288188  - passport@provinsal.com  - joeltuff
View Profile WWW Email
« Reply #2 on: September 28, 2008, 05:40:27 »

Thanks for the edification Cliff, as always. The Async messeging would drag me down, and the level of seperation would probably just hold me back at this point.

The way it is currently set up I only have to change the ViewPrepCommand in my core model for the specific application. I am trying to figure out how to not need to change the core at all, but I need to have at least one hook. In this case it is my ApplicationMediator that listens for the CORE_LOADED notification and initializes the specific application.

Would you have any thoughts on how I might notify my application specific structure after the core is loaded without altering the core classes? I'm stumped.
Logged

http://joelhooks.com - my ramblings about developing with actionscript and python using pureMVC and django respectively.
Joel Hooks
Courseware Beta
Sr. Member
***
Posts: 146


baby steps

 - 46288188  - passport@provinsal.com  - joeltuff
View Profile WWW Email
« Reply #3 on: September 28, 2008, 09:15:07 »

So just to answer my own question, I implemented an AbstractApplicationFacade which my main ApplicationFacade then extends. I had been messing around with Fabrication, and it was shielding me from the facade and made it harder to go this direction. It would work great if I was going to go for a fully modular approach, but I want to use the shared library for my core applications (while leaving it open for future modules).
Logged

http://joelhooks.com - my ramblings about developing with actionscript and python using pureMVC and django respectively.
Pages: [1]
Print