Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
class Facade(object, puremvc.interfaces.IFacade): #... def __new__(cls, *args, **kwargs): if not Facade.instance: Facade.instance = object.__new__(cls, *args, **kwargs) Facade.instance.initializeFacade() return Facade.instance @classmethod def getInstance(cls): if Facade.instance: return Facade.instance if cls is Facade: raise NotImplementedError('Cannot create instances of Facade directly.') return cls() #...
* public class MyFacade extends Facade * { * // Notification constants. The Facade is the ideal * // location for these constants, since any part * // of the application participating in PureMVC * // Observer Notification will know the Facade. * public static const GO_COMMAND:String = "go"; * * // Override Singleton Factory method * public static function getInstance() : MyFacade { * if (instance == null) instance = new MyFacade(); * return instance as MyFacade; * }