diff --git a/balking/README.md b/balking/README.md index f659d278b..cdd09cf5b 100644 --- a/balking/README.md +++ b/balking/README.md @@ -29,6 +29,10 @@ Wikipedia says > The balking pattern is a software design pattern that only executes an action on an object when the object is in a particular state. For example, if an object reads ZIP files and a calling method invokes a get method on the object when the ZIP file is not open, the object would "balk" at the request. +Flowchart + +![Balking flowchart](./etc/balking-flowchart.png) + ## Programmatic Example of Balking Pattern in Java This example demonstrates the Balking Pattern in a multithreaded Java application, highlighting state management and concurrency control. The Balking Pattern is exemplified by a washing machine's start button that initiates washing only if the machine is idle. This ensures state management and prevents concurrent issues. diff --git a/balking/etc/balking-flowchart.png b/balking/etc/balking-flowchart.png new file mode 100644 index 000000000..400a1ce8d Binary files /dev/null and b/balking/etc/balking-flowchart.png differ diff --git a/bloc/README.md b/bloc/README.md index 228af1634..da494dba3 100644 --- a/bloc/README.md +++ b/bloc/README.md @@ -35,6 +35,10 @@ The Bloc pattern manages the state of an object and allows for dynamically notif > While not a formalized "Gang of Four" design pattern, Bloc is widely used in state-driven applications. It centralizes state management and propagates state changes to registered observers, following principles of separation of concerns. +### Sequence diagram + +![Bloc sequence diagram](./etc/bloc-sequence-diagram.png) + --- ## Programmatic Example of the Bloc Pattern in Java diff --git a/bloc/etc/bloc-sequence-diagram.png b/bloc/etc/bloc-sequence-diagram.png new file mode 100644 index 000000000..588863985 Binary files /dev/null and b/bloc/etc/bloc-sequence-diagram.png differ diff --git a/bridge/README.md b/bridge/README.md index 9c45078d2..26567b292 100644 --- a/bridge/README.md +++ b/bridge/README.md @@ -36,6 +36,10 @@ Wikipedia says > The bridge pattern is a design pattern used in software engineering that is meant to "decouple an abstraction from its implementation so that the two can vary independently" +Sequence diagram + +![Bridge sequence diagram](./etc/bridge-sequence-diagram.png) + ## Programmatic Example of Bridge Pattern in Java Imagine you have a weapon that can have various enchantments, and you need to combine different weapons with different enchantments. How would you handle this? Would you create multiple copies of each weapon, each with a different enchantment, or would you create separate enchantments and apply them to the weapon as needed? The Bridge pattern enables you to do the latter. @@ -203,10 +207,6 @@ The hammer is unwielded. The item's glow fades. ``` -## Bridge Pattern Class Diagram - -![Bridge](./etc/bridge.urm.png "Bridge class diagram") - ## When to Use the Bridge Pattern in Java Consider using the Bridge pattern when: diff --git a/bridge/etc/bridge-sequence-diagram.png b/bridge/etc/bridge-sequence-diagram.png new file mode 100644 index 000000000..b79782762 Binary files /dev/null and b/bridge/etc/bridge-sequence-diagram.png differ