package employees
{
	import org.puremvc.as3.multicore.patterns.facade.Facade;
	import employees.controller.*;
	
	public class ApplicationFacade extends Facade
	{
		public static const STARTUP:String = 'startup';
		public static const LOAD_EMPLOYEES:String = 'loadEmployees';
		
		public function ApplicationFacade(key:String) {
			super(key);
		}
		
		public static function getInstance(key:String):ApplicationFacade {
			if (instanceMap[key] == null)
				instanceMap[key] = new ApplicationFacade(key);
			
			return instanceMap[key] as ApplicationFacade;
		}
		
		override protected function initializeController():void {
			super.initializeController();
			
			registerCommand(STARTUP, StartupCommand);
			registerCommand(LOAD_EMPLOYEES, LoadEmployeesCommand);
		}
		
		public function startup(app:sampleApp):void {
			sendNotification(STARTUP, app);
		}
	}
}