Skip to content

Commit ac9a1d0

Browse files
committed
Collapsible class diagram
1 parent 7b2a6b2 commit ac9a1d0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

chapter01_strategy/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
> **Strategy**: defines a family of algorithms, encapsulates each one and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.
44
5+
<details><summary>Class Diagram</summary><p>
6+
57
```mermaid
68
classDiagram
79
Client "1" --> "1" Strategy
@@ -23,4 +25,7 @@ Strategy "1" <|.. "*" ConcreteStrategyB
2325
}
2426
```
2527

28+
</p></details>
29+
30+
2631
I think the more pythonic approach would be to define methods rather than classes, and this would not violate the above definition. The class-based approach is needed in Java and has the advantage of explicitly setting out the required method in an abstract base class.

0 commit comments

Comments
 (0)