diff --git a/event-aggregator/README.md b/event-aggregator/README.md index a052e87c4..063aac502 100644 --- a/event-aggregator/README.md +++ b/event-aggregator/README.md @@ -36,6 +36,10 @@ In Plain Words > Event Aggregator is a design pattern that allows multiple event sources to communicate with event handlers through a central point, rather than having each event source communicate directly with each handler. +Sequence diagram + +![Event Aggregator sequence diagram](./etc/event-aggregator-sequence-diagram.png) + ## Programmatic Example of Event Aggregator Pattern in Java Consider the following example where we use the Event Aggregator to handle multiple events. @@ -161,10 +165,6 @@ The console output after running the example. 21:37:38.739 [main] INFO com.iluwatar.event.aggregator.KingJoffrey -- Received event from the King's Hand: Traitor detected ``` -## Detailed Explanation of Event Aggregator Pattern with Real-World Examples - -![Event Aggregator](./etc/classes.png "Event Aggregator") - ## When to Use the Event Aggregator Pattern in Java Use the Event Aggregator pattern when diff --git a/event-aggregator/etc/event-aggregator-sequence-diagram.png b/event-aggregator/etc/event-aggregator-sequence-diagram.png new file mode 100644 index 000000000..f96fbc427 Binary files /dev/null and b/event-aggregator/etc/event-aggregator-sequence-diagram.png differ diff --git a/event-based-asynchronous/README.md b/event-based-asynchronous/README.md index eee9758dd..6eb885c71 100644 --- a/event-based-asynchronous/README.md +++ b/event-based-asynchronous/README.md @@ -32,6 +32,10 @@ In Plain Words > The Event-Based Asynchronous design pattern allows tasks to be executed in the background, notifying the main program via events when completed, thereby enhancing system efficiency and responsiveness without blocking ongoing operations. +Sequence diagram + +![Event-Based Asynchronous sequence diagram](./etc/event-based-asynchronous-sequence-diagram.png) + ## Programmatic Example of Event-Based Asynchronous Pattern in Java Event-Based Asynchronous design pattern allows tasks to be executed in the background, notifying the main program via events when completed, thereby enhancing system efficiency and responsiveness without blocking ongoing operations. diff --git a/event-based-asynchronous/etc/event-based-asynchronous-sequence-diagram.png b/event-based-asynchronous/etc/event-based-asynchronous-sequence-diagram.png new file mode 100644 index 000000000..882975df5 Binary files /dev/null and b/event-based-asynchronous/etc/event-based-asynchronous-sequence-diagram.png differ diff --git a/event-queue/README.md b/event-queue/README.md index 8b2991b1d..08d807937 100644 --- a/event-queue/README.md +++ b/event-queue/README.md @@ -35,6 +35,10 @@ Wikipedia says > Message queues (also known as event queues) implement an asynchronous communication pattern between two or more processes/threads whereby the sending and receiving party do not need to interact with the queue at the same time. +Sequence diagram + +![Event Queue sequence diagram](./etc/event-queue-sequence-diagram.png) + ## Programmatic Example of Event Queue Pattern in Java This example demonstrates an application using an event queue system to handle audio playback asynchronously. diff --git a/event-queue/etc/event-queue-sequence-diagram.png b/event-queue/etc/event-queue-sequence-diagram.png new file mode 100644 index 000000000..26e01a79e Binary files /dev/null and b/event-queue/etc/event-queue-sequence-diagram.png differ diff --git a/execute-around/README.md b/execute-around/README.md index aea3ae9e7..9587674de 100644 --- a/execute-around/README.md +++ b/execute-around/README.md @@ -39,6 +39,10 @@ In plain words > Basically it's the pattern where you write a method to do things which are always required, e.g. resource allocation and clean-up, and make the caller pass in "what we want to do with the resource". +Flowchart + +![Execute Around flowchart](./etc/execute-around-flowchart.png) + ## Programmatic Example of Execute Around Pattern in Java The Execute Around Pattern is a design pattern that is widely used in Java programming to manage resource allocation and deallocation. It ensures that important setup and cleanup operations are performed reliably around a core business operation. This pattern is particularly useful for resource management, such as handling files, databases, or network connections in Java applications. diff --git a/execute-around/etc/execute-around-flowchart.png b/execute-around/etc/execute-around-flowchart.png new file mode 100644 index 000000000..3a9048585 Binary files /dev/null and b/execute-around/etc/execute-around-flowchart.png differ diff --git a/extension-objects/README.md b/extension-objects/README.md index 058fce654..82704008d 100644 --- a/extension-objects/README.md +++ b/extension-objects/README.md @@ -33,6 +33,10 @@ Wikipedia says > In object-oriented computer programming, an extension objects pattern is a design pattern added to an object after the original object was compiled. The modified object is often a class, a prototype or a type. Extension object patterns are features of some object-oriented programming languages. There is no syntactic difference between calling an extension method and calling a method declared in the type definition. +Sequence diagram + +![Extension Objects sequence diagram](./etc/extension-objects-sequence-diagram.png) + ## Programmatic Example of Extension Objects Pattern in Java The Extension Objects pattern allows for the flexible extension of an object's behavior without modifying its structure, by attaching additional objects that can dynamically add new functionality. @@ -143,10 +147,6 @@ This produces the following console output. This example demonstrates how the Extension Objects pattern allows for the flexible extension of an object's behavior without modifying its structure. -## Detailed Explanation of Extension Objects Pattern with Real-World Examples - -![Extension_objects](./etc/extension_obj.png "Extension objects") - ## When to Use the Extension Objects Pattern in Java This pattern is applicable in scenarios where an object's functionality needs to be extended at runtime, avoiding the complications of subclassing. It's particularly useful in systems where object capabilities need to be augmented post-deployment, or where the capabilities might vary significantly across instances. diff --git a/extension-objects/etc/extension-objects-sequence-diagram.png b/extension-objects/etc/extension-objects-sequence-diagram.png new file mode 100644 index 000000000..46850163a Binary files /dev/null and b/extension-objects/etc/extension-objects-sequence-diagram.png differ