PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: Tekool on September 15, 2009, 08:00:13



Title: Non-visual module used as core in multicore
Post by: Tekool on September 15, 2009, 08:00:13
I often have the same problem. I need to use a connection protocol or a specific type of server that requires me to have a group of 3 or 4 proxies to manage each type of connection to do near the same thing. I have to use alternatively one or another type of server in different build of the same app.

I have no problem to implement the same interface in my different proxies type, use the same commands when needed and decide which type of proxies and command to use when registering command/proxies. But I find more elegant not to have to worry about the two different proxies type simultaneously in the same project, even if I separate them into different packages. A native implementation of the IOC in PureMVC here would have probably been the solution to my problem. But I'm afraid that looking into and using Spring ActionScript for PureMVC or another solution take me too long for the project I'm working on.

So I wonder if this might be a good practice to create a core that would have no visual elements at all. Only a mediator for the application class, a group of 3 or 4 proxies and at most one state machine to manage the connection / disconnection when it is persistent one. Pipes literally controlling the module from the shell and other modules, even if I have some basic controller for initialization ?


Title: Re: Non-visual module used as core in multicore
Post by: puremvc on September 17, 2009, 09:14:36
Absolutely, this is a good idea. A core does not need to have a visual component or purpose in the View. A service module that has a clear message protocol for communications could easily be swapped for another server module speaking the same protocol but talking to a different service and returning its results over pipes.

-=Cliff>


Title: Re: Non-visual module used as core in multicore
Post by: Tekool on September 17, 2009, 12:36:07
Thank you Cliff for the answer.

I will use Flex modules with an API defined by the Pipes message that each module can send or receive.