File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,40 @@ for instance, in Django.
9
9
As I wrote out the code I found it very appealing that I did not need
10
10
to change the subject at all to add new observers.
11
11
12
+ ### Class Diagram
13
+
14
+ ``` mermaid
15
+
16
+ classDiagram
17
+
18
+ Subject <-- Observer : observers
19
+ Subject1 <-- Observer1 : subject
20
+ Subject1 <-- Observer2 : subject
21
+ Subject <|-- Subject1
22
+ Observer <|-- Observer1
23
+ Observer <|-- Observer2
24
+ Subject : attach(o)
25
+ Subject : detach(o)
26
+ Subject: notify()
27
+ class Observer{
28
+ +update()
29
+ }
30
+ class Subject1{
31
+ state
32
+ get_state()
33
+ set_state()
34
+ }
35
+ class Observer1{
36
+ state
37
+ update()
38
+ }
39
+ class Observer2{
40
+ state
41
+ update()
42
+ }
43
+
44
+ ```
45
+
12
46
## Running the code
13
47
14
48
``` bash
You can’t perform that action at this time.
0 commit comments