Packagecom.adobe.cairngorm.model
Interfacepublic interface ModelLocator

Marker interface used to mark the custom ModelLocator.

The ModelLocator is the marker interface used by Cairngorm applications to implement the model in an Model-View-Controller architecture.

The model locator in an application is a singleton that the application uses to store the client side model. An example implementation might be:

    [Bindable]
    public class ShopModelLocator implements ModelLocator
    {
       private static var modelLocator : ShopModelLocator;
       
       public static function getInstance() : ShopModelLocator 
       {
          if ( modelLocator == null )
              modelLocator = new ShopModelLocator();
              
          return modelLocator;
       }
     
       public var products : ICollectionView;
    }
    

Throughout the rest of the application, the developer can then access the products from the model, as follows:

      var products : ICollectionView = ModelLocator.getInstance().products;