Purpose: Defines the skeleton of an algorithm in a base class but lets subclasses override specific steps of the algorithm without changing its structure.
- Use Cases:
- Framework Design: In
frameworks, base classes define a general workflow (e.g., data
processing) while subclasses implement specific details.
- Game Development: A base
class can define a game loop structure, with subclasses implementing
specific game rules or behaviors.
No comments:
Post a Comment