AbstractFactory API Documentation

class AbstractProductA[source]

Bases: ABC

Abstract interface for ProductA.

abstractmethod operation_a()[source]

Perform an operation specific to ProductA.

Return type:

str

class AbstractProductB[source]

Bases: ABC

Abstract interface for ProductB.

abstractmethod operation_b()[source]

Perform an operation specific to ProductB.

Return type:

str

class ConcreteProductA1[source]

Bases: AbstractProductA

Concrete implementation of ProductA for Family 1.

operation_a()[source]

Implement operation A for ConcreteProductA1.

Return type:

str

class ConcreteProductA2[source]

Bases: AbstractProductA

Concrete implementation of ProductA for Family 2.

operation_a()[source]

Implement operation A for ConcreteProductA2.

Return type:

str

class ConcreteProductB1[source]

Bases: AbstractProductB

Concrete implementation of ProductB for Family 1.

operation_b()[source]

Implement operation B for ConcreteProductB1.

Return type:

str

class ConcreteProductB2[source]

Bases: AbstractProductB

Concrete implementation of ProductB for Family 2.

operation_b()[source]

Implement operation B for ConcreteProductB2.

Return type:

str

class AbstractFactory[source]

Bases: ABC

Abstract Factory interface.

abstractmethod create_product_a()[source]

Create a product of type A.

Return type:

AbstractProductA

abstractmethod create_product_b()[source]

Create a product of type B.

Return type:

AbstractProductB

class ConcreteFactory1[source]

Bases: AbstractFactory

Concrete Factory 1: Creates products belonging to Family 1.

create_product_a()[source]

Create a product of type A (ConcreteProductA1).

Return type:

AbstractProductA

create_product_b()[source]

Create a product of type B (ConcreteProductB1).

Return type:

AbstractProductB

class ConcreteFactory2[source]

Bases: AbstractFactory

Concrete Factory 2: Creates products belonging to Family 2.

create_product_a()[source]

Create a product of type A (ConcreteProductA2).

Return type:

AbstractProductA

create_product_b()[source]

Create a product of type B (ConcreteProductB2).

Return type:

AbstractProductB