diff --git a/.obsidian/plugins/text-extractor/cache/2b3169c79b04f258e20cf9c4f6284743.json b/.obsidian/plugins/text-extractor/cache/2b3169c79b04f258e20cf9c4f6284743.json new file mode 100644 index 0000000..b59a535 --- /dev/null +++ b/.obsidian/plugins/text-extractor/cache/2b3169c79b04f258e20cf9c4f6284743.json @@ -0,0 +1 @@ +{"path":"Attachments/Pasted image 20250117141550.png","text":"Bridge: Pattern, Corrected zoperatiend RefinedAbstr1 | | RefinedAbstr2 ConcretelmplementerA | | ConcretelmplementerB E —— e E —— +operationimp() +operationimp()","libVersion":"0.3.2","langs":"deu+eng+fra"} \ No newline at end of file diff --git a/.obsidian/plugins/text-extractor/cache/68ad3f81dbfd4f6e397a57575cc61583.json b/.obsidian/plugins/text-extractor/cache/68ad3f81dbfd4f6e397a57575cc61583.json new file mode 100644 index 0000000..6d6fe5e --- /dev/null +++ b/.obsidian/plugins/text-extractor/cache/68ad3f81dbfd4f6e397a57575cc61583.json @@ -0,0 +1 @@ +{"path":"Attachments/Pasted image 20250117142732.png","text":"ACTIVITY: Bridge Pattern MillingMachine E D PartProgram .| ProgramStep +headUp() —— ( —— —— +headDown() L +se +setSpeed() CircleCut RectangleCut -centerX -upperX _+exec 0 -centerY -uppery p e MM1 -lowerY ey | e e ] hoadUp{ *headUp() +headDown() +headDown() +moveTo() +move To() +SetRPM() +setRPM() +setSpeed() +setSpeed()","libVersion":"0.3.2","langs":"deu+eng+fra"} \ No newline at end of file diff --git a/.obsidian/plugins/text-extractor/cache/de2b7e690557cdbbc985063d5f7c739a.json b/.obsidian/plugins/text-extractor/cache/de2b7e690557cdbbc985063d5f7c739a.json new file mode 100644 index 0000000..2dfbd87 --- /dev/null +++ b/.obsidian/plugins/text-extractor/cache/de2b7e690557cdbbc985063d5f7c739a.json @@ -0,0 +1 @@ +{"path":"Attachments/Pasted image 20250117141533.png","text":"Bridge: Pattern, As Published Abstraction Implementor - <> rrrn RefinedAbstraction ConcretelmplementerA | | ConcretelmplementerB +operation() +operationimp() +operationimp()","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 8bd52c9..aefa522 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -537,6 +537,9 @@ }, "active": "0276c662bb61f53b", "lastOpenFiles": [ + "Attachments/Pasted image 20250117142732.png", + "Attachments/Pasted image 20250117141550.png", + "Attachments/Pasted image 20250117141533.png", "Attachments/Pasted image 20250117115604.png", "Attachments/Pasted image 20250117112716.png", "0 Journal/0 Daily/2025-01-17.sync-conflict-20250117-094333-LIUMLEB.md", @@ -554,10 +557,7 @@ "Templates/Course Template.md", "Attachments/Pasted image 20250116171230.png", "5 Media/0 Books/More Effective Agile by Steve McConnell.md", - "Attachments/Pasted image 20250116163238.png", - "Attachments/Pasted image 20250116163115.png", "Temporary/Untitled 1.md", - "Attachments/Pasted image 20250116161534.png", "Temporary/Untitled.md", "5 Media/0 Books/Design Patterns by null.md", "5 Media/0 Books/null by null.md", diff --git a/5 Media/8 Courses/Design Patterns by Construx.md b/5 Media/8 Courses/Design Patterns by Construx.md index 5dfe4df..481c54e 100644 --- a/5 Media/8 Courses/Design Patterns by Construx.md +++ b/5 Media/8 Courses/Design Patterns by Construx.md @@ -234,7 +234,28 @@ Build a wrapper around a complex service to simplify the interface. - High cohesion / loose coupling (secondary, decouple the service provider) ### Bridge **Prerequisite**: Adapter Pattern +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. +Constraint force: layer of indirection: slight performance hit + +**Abstraction and Implementation can vary independently!** + +![[Pasted image 20250117141550.png]] + +Bridge is often inherently an Adapter. + +> [!NOTE] No definition of how "abstractions" get bound to "implementors" +> - statically at "abstraction" instantiation +> - dynamically as parameter or dependency injection? + +#### Design principles +- favor association over inheritance +- high coehision/ loose coupling +- design to invariants / design for change +- liskov substitutability + +![[Pasted image 20250117142732.png]] ### Strategy ### Composite diff --git a/Attachments/Pasted image 20250117141533.png b/Attachments/Pasted image 20250117141533.png new file mode 100644 index 0000000..18b8dfd Binary files /dev/null and b/Attachments/Pasted image 20250117141533.png differ diff --git a/Attachments/Pasted image 20250117141550.png b/Attachments/Pasted image 20250117141550.png new file mode 100644 index 0000000..6e86495 Binary files /dev/null and b/Attachments/Pasted image 20250117141550.png differ diff --git a/Attachments/Pasted image 20250117142732.png b/Attachments/Pasted image 20250117142732.png new file mode 100644 index 0000000..a61ebfa Binary files /dev/null and b/Attachments/Pasted image 20250117142732.png differ