def __init__(self, key): """ Constructor. This C{IController} implementation is a Multiton, so you should not call the constructor directly, but instead call the static Factory method, passing the unique key for this instance C{Controller.getInstance( multitonKey )} @raise MultitonError: if instance for this Multiton key has already been constructed """ """Local reference to View""" self.view = None """Mapping of Notification names to Command Classes""" self.commandMap = {} """The Multiton Key for this Core""" self.multitonKey = key if self.instanceMap.get(key) is not None: raise MultitonError(self.MULTITON_MSG) self.instanceMap[key] = self self.initializeController()
def __init__(self, key): """ Constructor. This C{IView} implementation is a Multiton, so you should not call the constructor directly, but instead call the static Multiton Factory method C{View.getInstance( multitonKey )} @raise MultitonError: if instance for this Multiton key has already been constructed """ """Mapping of Mediator names to Mediator instances""" self.mediatorMap = {} """Mapping of Notification names to Observer lists""" self.observerMap = {} """The Multiton Key for this Core""" self.multitonKey = key if self.instanceMap.get(key) is not None: raise MultitonError(self.MULTITON_MSG) self.instanceMap[key] = self self.mediatorMap = {} self.observerMap = {} self.initializeView()
def __init__(self, key): """ Constructor. This C{IFacade} implementation is a Multiton, so you should not call the constructor directly, but instead call the static Factory method, passing the unique key for this instance C{Facade.getInstance( multitonKey )} @raise MultitonError: if instance for this Multiton key has already been constructed """ # References to Model, View and Controller self.controller = None self.model = None self.view = None # The Multiton Key for this app self.multitonKey = key if self.instanceMap.get(key): raise MultitonError(self.MULTITON_MSG) self.initializeNotifier(key) self.instanceMap[key] = self self.initializeFacade()
def __init__(self, key): """ Constructor. This C{IModel} implementation is a Multiton, so you should not call the constructor directly, but instead call the static Multiton Factory method C{Model.getInstance( multitonKey )} @raise MultitonError: if instance for this Multiton key instance has already been constructed """ """Mapping of proxyNames to IProxy instances""" self.proxyMap = {} """The Multiton Key for this Core""" self.multitonKey = None if self.instanceMap.get(key) is not None: raise MultitonError(self.MULTITON_MSG) self.multitonKey = key self.instanceMap[key] = self self.proxyMap = {} self.initializeModel()
def facade(self): """ Return the Multiton Facade instance """ key = self.multitonKey if key is None: raise MultitonError(self.MULTITON_MSG) return puremvc.patterns.facade.Facade.getInstance(key)