Hi

I had the same problem and solved it my creating a ModuleServiceLocator
which extends the ServiceLocator. Probably not the best coding, but it works
(and for simplicity I user external apps, not modules). There are one main
ModuleServiceLocator, and each other module has their own ModuleServices
which the module registeres and unregisteres on the common
ModuleServiceLocator. Each module/application has their own unique key, so
you wont get any naming collisions.

More about the solution and download the code here: 
http://flexcoding.blogspot.com/2007/06/cairngorm-extension-moduleservicelocato.html



Michael Schmalle wrote:
> 
> Hi,
> 
> I have a question here I have tried to resolve myself but, I am interested
> in opinions.
> 
> Using the new modules algorithm. In my mind I have
> 
> Application (shell)
> 
>  - LoginModule
>  - ProjectModule
>  - ASDocModule
>  - DocumentModule
>  - WikiModule
> 
> Imagine the 'Application' is a desktop, where you start a program and that
> is a module. It seems to me in this new design pattern, using a
> FrontController for the whole application seems ludicrous. I mean, this is
> set up like we don't really even know what is going to be loaded into this
> desktop, except that we have defined interfaces for what DOES load into
> it.
> 
> The ServiceLocator is a singleton, so if you have a service locator
> defined
> in the 'Application' what should I do with the modules that have their own
> dependent service that have nothing to do with the shell application?
> 
> I know their are established methodologies out their but, we all know
> things
> must change and I think the current pattern in crgrm is to limiting for an
> application that delegates most of it's processes to module that are
> actually self executing encapsulated ententes themselves.
> 
> I have come up with some ideas that actually work but, I ran into a
> problem
> with the service locator. I have each module create a FrontController,
> these
> sub controllers register their commands to the ApplicationController
> through
> interface( no coupling here).
> 
> I can't get more specific but, if anyone wants to start a quick
> conversation
> about this and modules, I could maybe get more explicit.
> 
> Peace, Mike
> 
> 
> -- 
> Teoti Graphix
> http://www.teotigraphix.com
> 
> Blog - Flex2Components
> http://www.flex2components.com
> 
> You can find more by solving the problem then by 'asking the question'.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/CGRM-%3A%3A-ServiceLocator-%3A%3A-Modules---how-to-share-tf3081019.html#a10957757
Sent from the FlexCoders mailing list archive at Nabble.com.

Reply via email to