ModelLocator

変数を格納しとくためのクラスを作ると色々便利なことがわかったのでメモ。

package
{
    public class ModelLocator
    {
        private static var _instance:ModelLocator;

        public function  ModelLocator(enfocer:SingletonEnforcer)
        {
        }

        public static function  getInstance():ModelLocator
        {
            if (_instance == null )
            {
                _instance = new ModelLocator(new SingletonEnforcer());
            }

            return  _instance;
        }
    }
}

class  SingletonEnforcer
{
}