Return to Snippet

Revision: 6160
at May 2, 2008 02:14 by wintondeshong


Updated Code
/**
 * Base PureMVC Project
 */
package {
	
    import org.puremvc.as3.interfaces.IFacade;
    import org.puremvc.as3.patterns.facade.Facade;
	import controller.*;

	/**
	 * Simple ApplicationFacade for PureMVC Structured Project
	 */

    public class ApplicationFacade extends Facade implements IFacade {
		
		/**
         * Notification name constants
		 */
        public static const STARTUP:String = "startup";

		/**
		 * Singleton ApplicationFacade Factory Method
		 */
        public static function getInstance(): ApplicationFacade {
            
            if (instance == null) {
				instance = new ApplicationFacade( );
			}
            return instance as ApplicationFacade;
        }

		/**
		 * Broadcast the STARTUP Notification
		 */
		public function startup(app:Object):void {
			sendNotification( STARTUP, app );
		}
		
        /**
 		 * Register Commands with the Controller 
		 */
        override protected function initializeController():void 
        {
            super.initializeController();
                    
            registerCommand(STARTUP, StartupCommand);
        }
    }
}

Revision: 6159
at May 1, 2008 21:31 by wintondeshong


Initial Code
/**
 * Base PureMVC Project
 */
package {
	
    import org.puremvc.as3.interfaces.IFacade;
    import org.puremvc.as3.patterns.facade.Facade;
	import controller.*;

	/**
	 * Simple ApplicationFacade for PureMVC Structured Project
	 */

    public class ApplicationFacade extends Facade implements IFacade {
		
		/**
         * Notification name constants
		 */
        public static const STARTUP:String = "startup";

		/**
		 * Singleton ApplicationFacade Factory Method
		 */
        public static function getInstance(): ApplicationFacade {
            
            if (instance == null) {
				instance = new ApplicationFacade( );
			}
            return instance as ApplicationFacade;
        }

		/**
		 * Broadcast the STARTUP Notification
		 */
		public function startup(app:Object):void {
			sendNotification( STARTUP, app );
		}
		
        /**
 		 * Register Commands with the Controller 
		 */
        override protected function initializeController():void 
        {
            super.initializeController();
                    
            registerCommand(STARTUP, StartupCommand);
        }
    }
}

Initial URL

                                

Initial Description

                                

Initial Title
PureMVC ApplicationFacade Class Template

Initial Tags
class, textmate

Initial Language
Other