Base Plot Strategy¶
The Base Plot Strategy defines the abstract base class for all plot strategy implementations in the Domain Layer.
Overview¶
All plot strategies inherit from BasePlotStrategy which implements the Template Method design pattern.
Documentation¶
- Base Plot Strategy Class: Abstract base class implementation
Template Method Pattern¶
The base strategy provides:
- Common Interface: All strategies share the same execution signature
- Hook Methods: Subclasses override specific steps
- Invariant Steps: Base class handles common operations
- Flexible Extension: Easy to add new plot types
Pattern Structure¶
graph TD
A[BasePlotStrategy] -->|inherits| B[BarChartStrategy]
A -->|inherits| C[HeatmapStrategy]
A -->|inherits| D[UpSetStrategy]
A -->|inherits| E[...]
A -->|defines| F[execute method]
B -->|implements| G[_create_figure]
C -->|implements| H[_create_figure]
D -->|implements| I[_create_figure] Design Benefits¶
- Code Reuse: Common logic in base class
- Consistency: All strategies follow same pattern
- Extensibility: New strategies easily added
- Maintainability: Changes in one place affect all strategies