You can have multiple modelLocators and frontControlers but only one
serviceLocator. Your use case is one where multiple modelLocators make
sense.  

ModelLocators are just a way of making a single instance of the model
data available throughout the application.  As long as you understand
that and are are using it based on that understanding it shouldn't
cause any problems.

--- In [email protected], "boybles" <[EMAIL PROTECTED]> wrote:
>
> Is it possible to have a multiple AppModelLocators in Cairngorm...and 
> if so, how best to implement them?
> For example, I have several apps in my directory structure:
> 
>   *Component1
>      -business
>      -commands
>      -control
>         LAppModelLocator.as
>      -model
>      -view
>      -vo
>   *Component2
>      -business
>      -commands
>      -control
>         LAppModelLocator.as
>      -model
>      -view
>      -vo
>   *Common
>      -business
>      -commands
>      -control
>         LAppModelLocator.as
>      -model
>      -view
>      -vo
> Componnent1.mxml
> Component2.mxml
> 
> 
> Now I want to have common control,commands and business files to 
> share among the different components, so I created the Common 
> directory with a Common AppModelLocator.  The command actionscripts 
> in the "Common" directory structure use the common AppModelLocator 
> bindings.  So  in component1 or component 2, I'd be using the local 
> model locator bindings as well as the common model locator bindings 
> in the same file like this:
> 
> [Bindable]
> private var modelCommon : Common.model.AppModelLocator = 
> Common.model.AppModelLocator.getInstance();
>                       
> [Bindable]
> private var modelLocal: Component1.model.AppModelLocator = 
> Component1.model.AppModelLocator.getInstance();
> 
> Is this going to cause problems?  If so, is there a better way to do 
> this?
> 
> Boybles
>


Reply via email to