docs: def register(self, locator, factory):
          """
          Registers a component using a factory method.
  
          :param locator: a locator to identify component to be created.
  
          :param factory: a factory function that receives a locator and returns a created component.
          """
          if locator == None:
              raise Exception("Locator cannot be null")
          if factory == None:
              raise Exception("Factory cannot be null")
  
          self._registrations.append(Registration(locator, factory))