diff --git a/.obsidian/plugins/text-extractor/cache/317689b4568cc0512a441b6f8bdcca77.json b/.obsidian/plugins/text-extractor/cache/317689b4568cc0512a441b6f8bdcca77.json new file mode 100644 index 0000000..5c7bf7d --- /dev/null +++ b/.obsidian/plugins/text-extractor/cache/317689b4568cc0512a441b6f8bdcca77.json @@ -0,0 +1 @@ +{"path":"Attachments/Pasted image 20250117162946.png","text":"Observer: Often Used with Model-View-Controller A BC D 1 Observers 2 10 3 4 | z |80|10/10 a b c o Ÿ m4 A 2 a = 50% «“ ) —» change notification b = 30% } Subject - -»> requests, changes c= 20%","libVersion":"0.3.2","langs":"deu+eng+fra"} \ No newline at end of file diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 1540534..b27a568 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -537,6 +537,7 @@ }, "active": "0276c662bb61f53b", "lastOpenFiles": [ + "Attachments/Pasted image 20250117162946.png", "Attachments/Pasted image 20250117160123.png", "Attachments/Pasted image 20250117153316.png", "Attachments/Pasted image 20250117153232.png", @@ -549,7 +550,6 @@ "0 Journal/0 Daily/2025-01-17.sync-conflict-20250117-094333-LIUMLEB.md", "Attachments/Pasted image 20250117104237.png", "0 Journal/0 Daily/2025-01-17.sync-conflict-20250117-104331-LIUMLEB.md", - "Attachments/Pasted image 20250117102805.png", "Temporary/Interviews as an Employer.md", "5 Media/8 Courses/Design Patterns by Construx.md", "0 Journal/0 Daily/2025-01-17.md", diff --git a/5 Media/8 Courses/Design Patterns by Construx.md b/5 Media/8 Courses/Design Patterns by Construx.md index b001ac1..150ba77 100644 --- a/5 Media/8 Courses/Design Patterns by Construx.md +++ b/5 Media/8 Courses/Design Patterns by Construx.md @@ -338,9 +338,27 @@ Forces: > [!Note] Implementation Notes > - same notification interface for all observers on same subject (even if information needs are different) +> - update() might carry new the updated data, or its just a ping and the observer needs to pull upon the notification +> - no control over the order +> - subject may need prevent modification of state until all observers were notified +> - implementation is an interface and not a base class +Observer design patterns are often used with model-view-controller architectures +![[Pasted image 20250117162946.png]] +Variation on the theme: Event Channel: many publishers and many subscribers #### Design Principles +- high cohesion / loose coupling +- design to invariants / design for change +- encapsulation + + + +> [!NOTE] Key Points +> - pattern allows to notify many others when state changes +> - decoupling of information provider from information consumers +> - state data can be pushed on update() or pulled by observers +> - event channels (variant) supports many publishers and many subscribers on the same channel ### Template Method diff --git a/Attachments/Pasted image 20250117162946.png b/Attachments/Pasted image 20250117162946.png new file mode 100644 index 0000000..d7dc90d Binary files /dev/null and b/Attachments/Pasted image 20250117162946.png differ