diff --git a/.obsidian/plugins/text-extractor/cache/213f8492b9e5755c19a2d83f42018287.json b/.obsidian/plugins/text-extractor/cache/213f8492b9e5755c19a2d83f42018287.json new file mode 100644 index 0000000..23f18a5 --- /dev/null +++ b/.obsidian/plugins/text-extractor/cache/213f8492b9e5755c19a2d83f42018287.json @@ -0,0 +1 @@ +{"path":"Attachments/Pasted image 20250117152338.png","text":"Strategy: Pattern, Corrected ConcreteStrategyA ConcreteStrategyB E SE S","libVersion":"0.3.2","langs":"deu+eng+fra"} \ No newline at end of file diff --git a/.obsidian/plugins/text-extractor/cache/6a62a7c701b498d5beb3e6af1ddd5e3f.json b/.obsidian/plugins/text-extractor/cache/6a62a7c701b498d5beb3e6af1ddd5e3f.json new file mode 100644 index 0000000..9b54d6f --- /dev/null +++ b/.obsidian/plugins/text-extractor/cache/6a62a7c701b498d5beb3e6af1ddd5e3f.json @@ -0,0 +1 @@ +{"path":"Attachments/Pasted image 20250117153316.png","text":"Composite: Applying the Pattern FileSystemElement -name -name -capacity 1 | -size +format() +size() * +mount() +copy() +move() +unmount() +delete() / 0.1 +size() +copy() +copy() +move() +move() +add() +delete() +getNext() +delete()","libVersion":"0.3.2","langs":"deu+eng+fra"} \ No newline at end of file diff --git a/.obsidian/plugins/text-extractor/cache/71f92f732452fe05bc1d2b31c65fdd80.json b/.obsidian/plugins/text-extractor/cache/71f92f732452fe05bc1d2b31c65fdd80.json new file mode 100644 index 0000000..e84294d --- /dev/null +++ b/.obsidian/plugins/text-extractor/cache/71f92f732452fe05bc1d2b31c65fdd80.json @@ -0,0 +1 @@ +{"path":"Attachments/Pasted image 20250117160123.png","text":"Observer: Pattern, Corrected Subject Observer +register( anObserver ) n z +unregister( anObserver ) +update( Object o, Event e ) - = === = | +notify() I E ConcreteSubject ConcreteObserver i observerSiale ı +getState() +update() Z - ; +setState() +getState() . E public void notify() { public void update( Object o, .: ! ______| for( Observer obs:observers ) { Evente ) { - }obs.update( this, event ) subjectState = o.getState(); } }","libVersion":"0.3.2","langs":"deu+eng+fra"} \ No newline at end of file diff --git a/.obsidian/plugins/text-extractor/cache/e40959e60f2f81d6ad4b6b5d55f92e4a.json b/.obsidian/plugins/text-extractor/cache/e40959e60f2f81d6ad4b6b5d55f92e4a.json new file mode 100644 index 0000000..540ef5b --- /dev/null +++ b/.obsidian/plugins/text-extractor/cache/e40959e60f2f81d6ad4b6b5d55f92e4a.json @@ -0,0 +1 @@ +{"path":"Attachments/Pasted image 20250117153232.png","text":"Composite: Pattern Component Client +operation() +add() +remove() +getChild(): Component r ct S—— e +add() +remove() +getChild(): Component","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 aefa522..1540534 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -537,6 +537,10 @@ }, "active": "0276c662bb61f53b", "lastOpenFiles": [ + "Attachments/Pasted image 20250117160123.png", + "Attachments/Pasted image 20250117153316.png", + "Attachments/Pasted image 20250117153232.png", + "Attachments/Pasted image 20250117152338.png", "Attachments/Pasted image 20250117142732.png", "Attachments/Pasted image 20250117141550.png", "Attachments/Pasted image 20250117141533.png", @@ -546,16 +550,12 @@ "Attachments/Pasted image 20250117104237.png", "0 Journal/0 Daily/2025-01-17.sync-conflict-20250117-104331-LIUMLEB.md", "Attachments/Pasted image 20250117102805.png", - "Attachments/Pasted image 20250117102744.png", - "Attachments/Pasted image 20250117102354.png", - "Attachments/Pasted image 20250117100749.png", "Temporary/Interviews as an Employer.md", "5 Media/8 Courses/Design Patterns by Construx.md", "0 Journal/0 Daily/2025-01-17.md", "5 Media/0 Books/Software Project Survival Guide by Steve McConnell.md", "2 Personal/Lists/Want to Learn List.md", "Templates/Course Template.md", - "Attachments/Pasted image 20250116171230.png", "5 Media/0 Books/More Effective Agile by Steve McConnell.md", "Temporary/Untitled 1.md", "Temporary/Untitled.md", diff --git a/.obsidian_iphone/workspace-mobile.json b/.obsidian_iphone/workspace-mobile.json index dd86d08..180bf2c 100644 --- a/.obsidian_iphone/workspace-mobile.json +++ b/.obsidian_iphone/workspace-mobile.json @@ -83,12 +83,12 @@ "state": { "type": "markdown", "state": { - "file": "0 Journal/0 Daily/2025-01-17.md", + "file": "2 Personal/Lists/Business Ideas.md", "mode": "source", "source": true }, "icon": "lucide-file", - "title": "2025-01-17" + "title": "Business Ideas" } }, { @@ -836,6 +836,16 @@ { "id": "e976240249fa7a48", "type": "leaf", + "state": { + "type": "review-queue-list-view", + "state": {}, + "icon": "lucide-file", + "title": "Plugin no longer active" + } + }, + { + "id": "61eeca57be9043ff", + "type": "leaf", "state": { "type": "review-queue-list-view", "state": {}, @@ -863,6 +873,7 @@ }, "active": "df173488ffff07a0", "lastOpenFiles": [ + "0 Journal/0 Daily/2025-01-17.md", "0 Journal/0 Daily/2025-01-17.sync-conflict-20250117-094333-LIUMLEB.md", "0 Journal/0 Daily/2025-01-17.sync-conflict-20250117-104331-LIUMLEB.md", "Attachments/Pasted image 20250117102805.png", @@ -871,7 +882,6 @@ "Attachments/Pasted image 20250117102744.png", "Attachments/Pasted image 20250117104237.png", "0 Journal/0 Daily/2025-01-15.md", - "0 Journal/0 Daily/2025-01-17.md", "Attachments/Pasted image 20250115121640.png", "2 Personal/Lists/Packlisten/Packliste - Skitour.md", "2 Personal/Lists/Media/Filme.md", diff --git a/2 Personal/Lists/Business Ideas.md b/2 Personal/Lists/Business Ideas.md index 11fd851..60cbe82 100644 --- a/2 Personal/Lists/Business Ideas.md +++ b/2 Personal/Lists/Business Ideas.md @@ -31,8 +31,8 @@ Diese Liste kann auch mit `#idea/startup` oder mit `#business-idea` ergänzt wer - AI website um CV fotos zu perfektionieren. Mach ein foto mit egal welchem hintergrund und du kriegst ein professionelles foto zurück --> App sagt dir wie du fotographieren solltest (auch belichtung, etc.). Bezahlung pro hochqualitäts Foto download 2.- - cv scanner for companies with LLM (claude) wie floris es gemacht hatte - checklist app: (add default checklists (e.g. software projects survival guide)) - - Tinder for early startups and people who want to work there (early VPs) +- Exam Generator for teachers, including solutions generation ___ ```query tag:#idea/startup diff --git a/5 Media/8 Courses/Design Patterns by Construx.md b/5 Media/8 Courses/Design Patterns by Construx.md index 481c54e..b001ac1 100644 --- a/5 Media/8 Courses/Design Patterns by Construx.md +++ b/5 Media/8 Courses/Design Patterns by Construx.md @@ -234,6 +234,7 @@ Build a wrapper around a complex service to simplify the interface. - High cohesion / loose coupling (secondary, decouple the service provider) ### Bridge **Prerequisite**: Adapter Pattern +The bridge pattern is very dynamic and can be changed during runtime very quickly (strategy pattern is more static.) Remember the fundamental design pattern of favouring association over inheritance. In a CNC-milling machine example we have 60 different subclasses of a programStep, which all cut different cuts. If I want to add a new communication protocol to communicate with the machine (tcp instead of serial) I would have to add another layer which adds another 60 subclasses, and so forth. This would be really bad and this is where the bridge pattern thrives: Goal force: decouple abstraction from implementation so that the two can vary independently. There are variations on two dimensions: the type of cut, the type of communication. @@ -257,10 +258,89 @@ Bridge is often inherently an Adapter. ![[Pasted image 20250117142732.png]] ### Strategy +Forces: +- behavior needs to change at runtime +- support different solutions to a particular problem +- insulate clients from details of the solutions +- added layer of indirection is acceptable (hit on performance) + +![[Pasted image 20250117152338.png]] + + +> [!NOTE] Implementation Note +> No definition of how nor when "context" gets bound to "concrete strategies" +> - client decides +> - broker or agent decides +> - parameter +> - dependency injection +> +> Concrete strategies need identical interface but maybe not the same parameters + +Example: sorting algorithms +different sorting algorithms have different properties. Strategy design pattern can be used to let clients use different sort algorithms + +#### Design principles +- design to invariants / design for change +- encapsulation +- liskov substitutability +- high cohesion / loose coupling + +> [!Important] Key Points +> Strategy defines family of algorithms, encapsulates each one and makes them interchangable ### Composite +No prerequisite +Allows to use recursion: example: make folders inside folders inside folders -### Observer +#### Forces +- need to represent hierarchical structures +- need to treat primitive elements and composites as uniformly as possible + - copying, moving, deleting files has same effect as on folder + - resizing one shape on drawing has same effect as resizing group of shapes +What you can do with an individual you should do with a group + +![[Pasted image 20250117153232.png]] +![[Pasted image 20250117153316.png]] + + +> [!NOTE] Implementation Notes +> - depth first vs breadth-first might be relevant in operations that traverse structure. +> - ordering of compoonents in composite might be relevant +> - shallow copy vs deep copy (**implement in contract! Should be crystal clear**) +> - **shallow**: Only immediate object copied, not sub-referenced objects +> - **deep**: copy object and all sub-referenced objects. + +#### Design Principles +- Abstraction +- Design to invariants/design for change +- encapsulation +- liskov substitutability +- high cohesion / loose coupling + +> [!Important] Key Points +> - hierarchical structure +> - treat primitive elementss and composites as uniformly as possible +> - copying, moving, deleting +> - resizing single shape has same effect as resizing multiple grouped shapes +> - be careful with copy() semantics --> communicate through contract + +### Observer aka. Publish-Subscribe +prerequisites: None +aka: Implicit Invocation, Publish-Subscribe + +Forces: +- 1-to-many dependency requiring object to notify many other objects when it changes state +- need to limit direct knowledge the many and the one have of each otehr +- added layer of indirection is acceptable (performance hit) + +![[Pasted image 20250117160123.png]] + + +> [!Note] Implementation Notes +> - same notification interface for all observers on same subject (even if information needs are different) + + +#### Design Principles ### Template Method diff --git a/Attachments/Pasted image 20250117152338.png b/Attachments/Pasted image 20250117152338.png new file mode 100644 index 0000000..7411438 Binary files /dev/null and b/Attachments/Pasted image 20250117152338.png differ diff --git a/Attachments/Pasted image 20250117153232.png b/Attachments/Pasted image 20250117153232.png new file mode 100644 index 0000000..a952f7b Binary files /dev/null and b/Attachments/Pasted image 20250117153232.png differ diff --git a/Attachments/Pasted image 20250117153316.png b/Attachments/Pasted image 20250117153316.png new file mode 100644 index 0000000..ee1be0b Binary files /dev/null and b/Attachments/Pasted image 20250117153316.png differ diff --git a/Attachments/Pasted image 20250117160123.png b/Attachments/Pasted image 20250117160123.png new file mode 100644 index 0000000..e2c53fc Binary files /dev/null and b/Attachments/Pasted image 20250117160123.png differ