TemplateMethod API Documentation
- class AbstractClass[source]
Bases:
ABCAbstract class that defines the skeleton of an algorithm. Subclasses must implement specific steps of the algorithm.
- template_method()[source]
Defines the algorithm’s skeleton by calling base operations, required steps, and hooks in a predefined order.
- Return type:
- abstractmethod required_operation1()[source]
A required operation that must be implemented by subclasses.
- Return type:
- class ConcreteClass1[source]
Bases:
AbstractClassA concrete implementation of the abstract class with its own behavior.
- required_operation1()[source]
A required operation that must be implemented by subclasses. In this case, this method adds its own behavior before or after calling the base implementation.
- Return type:
- class ConcreteClass2[source]
Bases:
AbstractClassAnother concrete implementation of the abstract class with its own behavior.