diff options
Diffstat (limited to 'diagrams/assignment_3/mmd/template_method_pattern.mmd')
| -rw-r--r-- | diagrams/assignment_3/mmd/template_method_pattern.mmd | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/diagrams/assignment_3/mmd/template_method_pattern.mmd b/diagrams/assignment_3/mmd/template_method_pattern.mmd new file mode 100644 index 0000000..96e7605 --- /dev/null +++ b/diagrams/assignment_3/mmd/template_method_pattern.mmd @@ -0,0 +1,26 @@ +classDiagram + class Simulator~T~ { + <<abstract>> + +Run(runTime: int) + #ProcessTimeStep() + #FindPreyIfNeeded(entity: T) + #CheckAndFeed(entity: T) + #FindNearestPrey(predator: T) Entity* + } + + class Dish { + #FindNearestPrey(predator: Morg) Entity* + } + + Simulator~T~ <|-- Dish + + note for Simulator~T~ "Template Method Pattern: +Run() defines the algorithm +ProcessTimeStep() is the template +FindPreyIfNeeded() is virtual +CheckAndFeed() is virtual +FindNearestPrey() is abstract" + + note for Dish "Concrete implementation: +Implements FindNearestPrey() +for Morg-specific prey finding" |