PureMVC ApplicationFacade类模板

【PureMVC ApplicationFacade类模板】千磨万击还坚劲,任尔东西南北风。这篇文章主要讲述PureMVC ApplicationFacade类模板相关的知识,希望能为你提供帮助。

  1. /**
  2. * Base PureMVC Project
  3. */
  4. package {
  5.  
  6. import org.puremvc.as3.interfaces.IFacade;
  7. import org.puremvc.as3.patterns.facade.Facade;
  8. import controller.*;
  9.  
  10. /**
  11. * Simple ApplicationFacade for PureMVC Structured Project
  12. */
  13.  
  14. public class ApplicationFacade extends Facade implements IFacade {
  15.  
  16. /**
  17. * Notification name constants
  18. */
  19. public static const STARTUP:String = " startup" ;
  20.  
  21. /**
  22. * Singleton ApplicationFacade Factory Method
  23. */
  24. public static function getInstance(): ApplicationFacade {
  25.  
  26. if (instance == null) {
  27. instance = new ApplicationFacade( );
  28. }
  29. return instance as ApplicationFacade;
  30. }
  31.  
  32. /**
  33. * Broadcast the STARTUP Notification
  34. */
  35. public function startup(app:Object):void {
  36. sendNotification( STARTUP, app );
  37. }
  38.  
  39. /**
  40. * Register Commands with the Controller
  41. */
  42. override protected function initializeController():void
  43. {
  44. super.initializeController();
  45.  
  46. registerCommand(STARTUP, StartupCommand);
  47. }
  48. }
  49. }


    推荐阅读