diff --git a/builder/README.md b/builder/README.md index 6a36c334c..cf6e3242d 100644 --- a/builder/README.md +++ b/builder/README.md @@ -40,6 +40,10 @@ public Hero(Profession profession,String name,HairType hairType,HairColor hairCo As you can see, the number of constructor parameters can quickly become overwhelming, making it difficult to understand their arrangement. Additionally, this list of parameters might continue to grow if you decide to add more options in the future. This is known as the telescoping constructor antipattern. +Sequence diagram + +![Builder sequence diagram](./etc/builder-sequence-diagram.png) + ## Programmatic Example of Builder Pattern in Java In this Java Builder pattern example, we construct different types of `Hero` objects with varying attributes. @@ -146,10 +150,6 @@ Program output: 16:28:06.060 [main] INFO com.iluwatar.builder.App -- This is a thief named Desmond with bald head and wielding a bow. ``` -## Builder Pattern Class Diagram - -![Builder](./etc/builder.urm.png "Builder class diagram") - ## When to Use the Builder Pattern in Java Use the Builder pattern when diff --git a/builder/etc/builder-sequence-diagram.png b/builder/etc/builder-sequence-diagram.png new file mode 100644 index 000000000..355556637 Binary files /dev/null and b/builder/etc/builder-sequence-diagram.png differ diff --git a/business-delegate/README.md b/business-delegate/README.md index 3a3203b23..9f83e1a17 100644 --- a/business-delegate/README.md +++ b/business-delegate/README.md @@ -36,6 +36,10 @@ Wikipedia says > Business Delegate is a Java EE design pattern. This pattern is directing to reduce the coupling in between business services and the connected presentation tier, and to hide the implementation details of services (including lookup and accessibility of EJB architecture). Business Delegates acts as an adaptor to invoke business objects from the presentation tier. +Sequence diagram + +![Business Delegate sequence diagram](./etc/business-delegate-sequence-diagram.png) + ## Programmatic Example of Business Delegate Pattern in Java The following Java code demonstrates how to implement the Business Delegate pattern. This pattern is particularly useful in applications requiring loose coupling and efficient service interaction. @@ -145,10 +149,6 @@ Here is the console output. 21:15:33.794 [main] INFO com.iluwatar.business.delegate.YouTubeService - YouTubeService is now processing ``` -## Business Delegate Pattern Class Diagram - -![Business Delegate](./etc/business-delegate.urm.png "Business Delegate") - ## When to Use the Business Delegate Pattern in Java Use the Business Delegate pattern when diff --git a/business-delegate/etc/business-delegate-sequence-diagram.png b/business-delegate/etc/business-delegate-sequence-diagram.png new file mode 100644 index 000000000..a6279e9d1 Binary files /dev/null and b/business-delegate/etc/business-delegate-sequence-diagram.png differ diff --git a/bytecode/README.md b/bytecode/README.md index 889354cf3..793eecffc 100644 --- a/bytecode/README.md +++ b/bytecode/README.md @@ -31,6 +31,10 @@ In plain words > An instruction set defines the low-level operations that can be performed. A series of instructions is encoded as a sequence of bytes. A virtual machine executes these instructions one at a time, using a stack for intermediate values. By combining instructions, complex high-level behavior can be defined. +Sequence diagram + +![Bytecode sequence diagram](./etc/bytecode-sequence-diagram.png) + ## Programmatic Example of Bytecode Pattern in Java In this programmatic example, we show how the Bytecode pattern in Java can simplify the execution of complex virtual machine instructions through a well-defined set of operations. This real-world example demonstrates how the Bytecode design pattern in Java can streamline game programming by allowing wizards' behavior to be easily adjusted through bytecode instructions. diff --git a/bytecode/etc/bytecode-sequence-diagram.png b/bytecode/etc/bytecode-sequence-diagram.png new file mode 100644 index 000000000..c863a0e0b Binary files /dev/null and b/bytecode/etc/bytecode-sequence-diagram.png differ diff --git a/caching/README.md b/caching/README.md index b923da87b..2e9c3761e 100644 --- a/caching/README.md +++ b/caching/README.md @@ -34,6 +34,10 @@ Wikipedia says > In computing, a cache is a hardware or software component that stores data so that future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation or a copy of data stored elsewhere. A cache hit occurs when the requested data can be found in a cache, while a cache miss occurs when it cannot. Cache hits are served by reading data from the cache, which is faster than recomputing a result or reading from a slower data store; thus, the more requests that can be served from the cache, the faster the system performs. +Flowchart + +![Caching flowchart](./etc/caching-flowchart.png) + ## Programmatic Example of Caching Pattern in Java In this programmatic example, we demonstrate different Java caching strategies, including write-through, write-around, and write-behind, using a user account management system. diff --git a/caching/etc/caching-flowchart.png b/caching/etc/caching-flowchart.png new file mode 100644 index 000000000..8068392cd Binary files /dev/null and b/caching/etc/caching-flowchart.png differ diff --git a/callback/README.md b/callback/README.md index 1c90cdcea..9c109310d 100644 --- a/callback/README.md +++ b/callback/README.md @@ -37,6 +37,11 @@ Wikipedia says > In computer programming, a callback, also known as a "call-after" function, is any executable code that is passed as an argument to other code; that other code is expected to call back (execute) the argument at a given time. +Sequence diagram + +![Callback sequence diagram](./etc/callback-sequence-diagram.png) + + ## Programmatic Example of Callback Pattern in Java We need to be notified after the executing task has finished. We pass a callback method for the executor and wait for it to call back on us. diff --git a/callback/etc/callback-sequence-diagram.png b/callback/etc/callback-sequence-diagram.png new file mode 100644 index 000000000..5922734d8 Binary files /dev/null and b/callback/etc/callback-sequence-diagram.png differ diff --git a/chain-of-responsibility/README.md b/chain-of-responsibility/README.md index f8c926973..454147dcd 100644 --- a/chain-of-responsibility/README.md +++ b/chain-of-responsibility/README.md @@ -35,6 +35,10 @@ Wikipedia says > In object-oriented design, the chain-of-responsibility pattern is a design pattern consisting of a source of command objects and a series of processing objects. Each processing object contains logic that defines the types of command objects that it can handle; the rest are passed to the next processing object in the chain. +Flowchart + +![Chain of Responsibility flowchart](./etc/chain-of-responsibility-flowchart.png) + ## Programmatic Example of Chain of Responsibility Pattern In this Java example, the Orc King gives orders which are processed by a chain of command representing the Chain of Responsibility pattern. Learn how to implement this design pattern in Java with the following code snippet. @@ -159,10 +163,6 @@ Orc officer handling request "torture prisoner" Orc soldier handling request "collect tax" ``` -## Chain of Responsibility Pattern Class Diagram - -![Chain of Responsibility](./etc/chain-of-responsibility.urm.png "Chain of Responsibility class diagram") - ## When to Use the Chain of Responsibility Pattern in Java Use Chain of Responsibility when diff --git a/chain-of-responsibility/etc/chain-of-responsibility-flowchart.png b/chain-of-responsibility/etc/chain-of-responsibility-flowchart.png new file mode 100644 index 000000000..875507374 Binary files /dev/null and b/chain-of-responsibility/etc/chain-of-responsibility-flowchart.png differ