design-patterns/creational/abstract_factory/AbstractFactory.py
2020-09-29 22:05:56 +02:00

23 lines
806 B
Python

from abc import ABC, abstractmethod
from creational.abstract_factory.AbstractProductA import AbstractProductA
from creational.abstract_factory.AbstractProductB import AbstractProductB
class AbstractFactory(ABC):
"""
The Abstract Factory interface declares a set of methods that return
different abstract products. These products are called a family and are
related by a high-level theme or concept. Products of one family are
usually able to collaborate among themselves. A family of products may have
several variants, but the products of one variant are incompatible with
products of another.
"""
@abstractmethod
def create_product_a(self) -> AbstractProductA:
pass
@abstractmethod
def create_product_b(self) -> AbstractProductB:
pass