vault backup: 2025-01-17 16:09:15

This commit is contained in:
2025-01-17 16:09:16 +01:00
parent 40e6b7ded9
commit ace642ca60
12 changed files with 103 additions and 9 deletions

View File

@@ -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"}

View File

@@ -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"}

View File

@@ -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"}

View File

@@ -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"}

View File

@@ -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",

View File

@@ -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",

View File

@@ -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

View File

@@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 679 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB