Package pypat :: Package creational :: Module factory :: Class Factory
[hide private]
[frames] | no frames]

Class Factory

source code


Factory Interface.

All Factories should inherit this class and overwrite the create method.

- External Usage documentation: U{https://github.com/tylerlaberge/PyPatterns/wiki/Creational-Pattern-Usage}
- External Factory Pattern documentation: U{https://en.wikipedia.org/wiki/Factory_method_pattern}

Instance Methods [hide private]
 
create(self, **kwargs)
Abstract create method.
source code
Method Details [hide private]

create(self, **kwargs)

source code 

Abstract create method.

Concrete implementations should return a new instance of the object the factory class is responsible for.

Parameters:
  • kwargs - Arguments for object creation.
Returns:
A new instance of the object the factory is responsible for.
Decorators:
  • @abstractmethod