diff --git a/version-number/README.md b/version-number/README.md index 6178f2317..8a1804650 100644 --- a/version-number/README.md +++ b/version-number/README.md @@ -35,6 +35,10 @@ Wikipedia says > The Version Number pattern is a technique used to manage concurrent access to data in databases and other data stores. It involves associating a version number with each record, which is incremented every time the record is updated. This pattern helps ensure that when multiple users or processes attempt to update the same data simultaneously, conflicts can be detected and resolved. +Flowchart + +![Version Number Pattern Flowchart](./etc/version-number-flowchart.png) + ## Programmatic Example of Version Number Pattern in Java Alice and Bob are working on the book, which stored in the database. Our heroes are making changes simultaneously, and we need some mechanism to prevent them from overwriting each other. diff --git a/version-number/etc/version-number-flowchart.png b/version-number/etc/version-number-flowchart.png new file mode 100644 index 000000000..2d60aa30f Binary files /dev/null and b/version-number/etc/version-number-flowchart.png differ diff --git a/virtual-proxy/README.md b/virtual-proxy/README.md index e5b32fd09..187eeec1d 100644 --- a/virtual-proxy/README.md +++ b/virtual-proxy/README.md @@ -35,6 +35,10 @@ Wikipedia says > A proxy that controls access to a resource that is expensive to create. +Sequence diagram + +![Virtual Proxy Sequence Diagram](./etc/virtual-proxy-sequence-diagram.png) + ## Programmatic Example of Virtual Proxy Pattern in Java The Virtual Proxy design pattern in Java can optimize resource utilization and system performance. diff --git a/virtual-proxy/etc/virtual-proxy-sequence-diagram.png b/virtual-proxy/etc/virtual-proxy-sequence-diagram.png new file mode 100644 index 000000000..9ff38c0ad Binary files /dev/null and b/virtual-proxy/etc/virtual-proxy-sequence-diagram.png differ diff --git a/visitor/README.md b/visitor/README.md index 674062606..bb5ee4e44 100644 --- a/visitor/README.md +++ b/visitor/README.md @@ -32,6 +32,10 @@ Wikipedia says > In object-oriented programming and software engineering, the visitor design pattern is a way of separating an algorithm from an object structure on which it operates. A practical result of this separation is the ability to add new operations to existing object structures without modifying the structures. +Sequence diagram + +![Visitor sequence diagram](./etc/visitor-sequence-diagram.png) + ## Programmatic Example of Visitor Pattern in Java Consider a tree structure with army units. Commander has two sergeants under it and each sergeant has three soldiers under them. Given that the hierarchy implements the visitor pattern, we can easily create new objects that interact with the commander, sergeants, soldiers, or all of them. @@ -221,10 +225,6 @@ Program output: 14:58:06.118 [main] INFO com.iluwatar.visitor.CommanderVisitor -- Good to see you commander ``` -## Detailed Explanation of Visitor Pattern with Real-World Examples - -![Visitor](./etc/visitor_1.png "Visitor") - ## When to Use the Visitor Pattern in Java Use the Visitor pattern when diff --git a/visitor/etc/visitor-sequence-diagram.png b/visitor/etc/visitor-sequence-diagram.png new file mode 100644 index 000000000..61264826d Binary files /dev/null and b/visitor/etc/visitor-sequence-diagram.png differ