diff --git a/identity-map/README.md b/identity-map/README.md index e2c5318bb..a63e11423 100644 --- a/identity-map/README.md +++ b/identity-map/README.md @@ -31,6 +31,10 @@ Wikipedia says > In the design of DBMS, the identity map pattern is a database access design pattern used to improve performance by providing a context-specific, in-memory cache to prevent duplicate retrieval of the same object data from the database. +Sequence diagram + +![Identity Map sequence diagram](./etc/identity-map-sequence-diagram.png) + ## Programmatic Example of Identity Map Pattern in Java For the purpose of this demonstration in Java programming, assume we have already created a database instance, showcasing the Identity Map pattern to avoid duplicate objects in memory. diff --git a/identity-map/etc/identity-map-sequence-diagram.png b/identity-map/etc/identity-map-sequence-diagram.png new file mode 100644 index 000000000..41011f30d Binary files /dev/null and b/identity-map/etc/identity-map-sequence-diagram.png differ diff --git a/intercepting-filter/etc/intercepting-filter-architecture-diagram.png b/intercepting-filter/etc/intercepting-filter-architecture-diagram.png index d53b5fd67..f70c0ec0c 100644 Binary files a/intercepting-filter/etc/intercepting-filter-architecture-diagram.png and b/intercepting-filter/etc/intercepting-filter-architecture-diagram.png differ diff --git a/interpreter/README.md b/interpreter/README.md index 0eeb035dc..9e9dd5439 100644 --- a/interpreter/README.md +++ b/interpreter/README.md @@ -32,6 +32,10 @@ Wikipedia says > In computer programming, the interpreter pattern is a design pattern that specifies how to evaluate sentences in a language. The basic idea is to have a class for each symbol (terminal or nonterminal) in a specialized computer language. The syntax tree of a sentence in the language is an instance of the composite pattern and is used to evaluate (interpret) the sentence for a client. +Sequence diagram + +![Interpreter sequence diagram](./etc/interpreter-sequence-diagram.png) + ## Programmatic Example of Interpreter Pattern in Java To be able to interpret basic math in Java, we need a hierarchy of expressions. The `Expression` class is the base, and concrete implementations like `NumberExpression` handle specific parts of the grammar. The Interpreter pattern in Java simplifies parsing and evaluating arithmetic expressions by translating them into a structured format that the application can process. @@ -174,10 +178,6 @@ Executing the program produces the following console output. 13:33:15.440 [main] INFO com.iluwatar.interpreter.App -- result: 8 ``` -## Detailed Explanation of Interpreter Pattern with Real-World Examples - -![Interpreter](./etc/interpreter_1.png "Interpreter") - ## When to Use the Interpreter Pattern in Java Use the Interpreter design pattern when there is a language to interpret, and you can represent statements in the language as abstract syntax trees. The Interpreter pattern works best when diff --git a/interpreter/etc/interpreter-sequence-diagram.png b/interpreter/etc/interpreter-sequence-diagram.png new file mode 100644 index 000000000..fbee04524 Binary files /dev/null and b/interpreter/etc/interpreter-sequence-diagram.png differ diff --git a/iterator/README.md b/iterator/README.md index 49bca61a0..bda2afde9 100644 --- a/iterator/README.md +++ b/iterator/README.md @@ -35,6 +35,10 @@ Wikipedia says > In object-oriented programming, the iterator pattern is a design pattern in which an iterator is used to traverse a container and access the container's elements. +Sequence diagram + +![Iterator sequence diagram](./etc/iterator-sequence-diagram.png) + ## Programmatic Example of Iterator Pattern in Java The main class in our Java Iterator Design Pattern example is the `TreasureChest` that contains items. This demonstrates how to implement and use iterators for efficient collection traversal in Java. diff --git a/iterator/etc/iterator-sequence-diagram.png b/iterator/etc/iterator-sequence-diagram.png new file mode 100644 index 000000000..ce887054c Binary files /dev/null and b/iterator/etc/iterator-sequence-diagram.png differ