diff --git a/callback/README.md b/callback/README.md index 9c109310d..923132ac5 100644 --- a/callback/README.md +++ b/callback/README.md @@ -41,7 +41,6 @@ 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/circuit-breaker/README.md b/circuit-breaker/README.md index b8e0ff248..99c1b7b4d 100644 --- a/circuit-breaker/README.md +++ b/circuit-breaker/README.md @@ -33,6 +33,10 @@ Wikipedia says > Circuit breaker is a design pattern used in modern software development. It is used to detect failures and encapsulates the logic of preventing a failure from constantly recurring, during maintenance, temporary external system failure or unexpected system difficulties. +Flowchart + +![Circuit Breaker flowchart](./etc/circuit-breaker-flowchart.png) + ## Programmatic Example of Circuit Breaker Pattern in Java This Java example demonstrates how the Circuit Breaker pattern can manage remote service failures and maintain system stability. diff --git a/circuit-breaker/etc/circuit-breaker-flowchart.png b/circuit-breaker/etc/circuit-breaker-flowchart.png new file mode 100644 index 000000000..6e0af83e0 Binary files /dev/null and b/circuit-breaker/etc/circuit-breaker-flowchart.png differ diff --git a/client-session/README.md b/client-session/README.md index c49e53c71..e693ef7db 100644 --- a/client-session/README.md +++ b/client-session/README.md @@ -33,6 +33,10 @@ Wikipedia says > The client-server model on Wikipedia describes a system where client devices request services and resources from centralized servers. This model is crucial in web applications where client sessions are used to manage user-specific data across multiple requests. For example, when a bank customer accesses online banking services, their login credentials and session state are managed by the web server to maintain continuity of their interactions. +Sequence diagram + +![Client Session sequence diagram](./etc/client-session-sequence-diagram.png) + ## Programmatic Example of Client Session Pattern in Java The Client Session design pattern is a behavioral design pattern that maintains a user's state and data across multiple requests within a web application, ensuring a continuous and personalized user experience. This pattern is commonly used in web applications where user-specific data needs to be managed across multiple requests. diff --git a/client-session/etc/client-session-sequence-diagram.png b/client-session/etc/client-session-sequence-diagram.png new file mode 100644 index 000000000..7d1282a9b Binary files /dev/null and b/client-session/etc/client-session-sequence-diagram.png differ diff --git a/collecting-parameter/README.md b/collecting-parameter/README.md index 55609aebd..89c37e79b 100644 --- a/collecting-parameter/README.md +++ b/collecting-parameter/README.md @@ -36,6 +36,10 @@ Wikipedia says > In the Collecting Parameter idiom a collection (list, map, etc.) is passed repeatedly as a parameter to a method which adds items to the collection. +Flowchart + +![Collecting Parameter flowchart](./etc/collecting-parameter-flowchart.png) + ## Programmatic Example of Collecting Parameter Pattern in Java Within a large corporate building, there exists a global printer queue that is a collection of all the printing jobs that are currently pending. Various floors contain different models of printers, each having a different printing policy. We must construct a program that can continually add appropriate printing jobs to a collection, which is called the collecting parameter. diff --git a/collecting-parameter/etc/collecting-parameter-flowchart.png b/collecting-parameter/etc/collecting-parameter-flowchart.png new file mode 100644 index 000000000..dcab61c2e Binary files /dev/null and b/collecting-parameter/etc/collecting-parameter-flowchart.png differ diff --git a/collection-pipeline/README.md b/collection-pipeline/README.md index 8f8764be2..33d207922 100644 --- a/collection-pipeline/README.md +++ b/collection-pipeline/README.md @@ -29,6 +29,10 @@ Wikipedia says > In software engineering, a pipeline consists of a chain of processing elements (processes, threads, coroutines, functions, etc.), arranged so that the output of each element is the input of the next; the name is by analogy to a physical pipeline. Usually some amount of buffering is provided between consecutive elements. The information that flows in these pipelines is often a stream of records, bytes, or bits, and the elements of a pipeline may be called filters; this is also called the pipe(s) and filters design pattern. Connecting elements into a pipeline is analogous to function composition. +Flowchart + +![Collection Pipeline flowchart](./etc/collection-pipeline-flowchart.png) + ## Programmatic Example of Collection Pipeline Pattern in Java The Collection Pipeline is a programming pattern where you organize some computation as a sequence of operations which compose by taking a collection as output of one operation and feeding it into the next. diff --git a/collection-pipeline/etc/collection-pipeline-flowchart.png b/collection-pipeline/etc/collection-pipeline-flowchart.png new file mode 100644 index 000000000..48ee51002 Binary files /dev/null and b/collection-pipeline/etc/collection-pipeline-flowchart.png differ diff --git a/combinator/README.md b/combinator/README.md index 0ebe7deea..93aa7792f 100644 --- a/combinator/README.md +++ b/combinator/README.md @@ -35,6 +35,10 @@ Wikipedia says > A combinator is a higher-order function that uses only function application and earlier defined combinators to define a result from its arguments. +Flowchart + +![Combinator flowchart](./etc/combinator-flowchart.png) + ## Programmatic Example of Combinator Pattern in Java In software design, combinatory logic is pivotal for creating reusable and modular code components. By leveraging higher-order functions, the Combinator pattern promotes code reuse and maintainability in Java applications. diff --git a/combinator/etc/combinator-flowchart.png b/combinator/etc/combinator-flowchart.png new file mode 100644 index 000000000..9cc8b3413 Binary files /dev/null and b/combinator/etc/combinator-flowchart.png differ diff --git a/command/README.md b/command/README.md index 8877f722e..761267c04 100644 --- a/command/README.md +++ b/command/README.md @@ -34,6 +34,10 @@ Wikipedia says > In object-oriented programming, the command pattern is a behavioral design pattern in which an object is used to encapsulate all information needed to perform an action or trigger an event at a later time. +Sequence diagram + +![Command sequence diagram](./etc/command-sequence-diagram.png) + ## Programmatic Example of Command Pattern in Java In the Command pattern, objects are used to encapsulate all information needed to perform an action or trigger an event at a later time. This pattern is particularly useful for implementing undo functionality in applications. diff --git a/command/etc/command-sequence-diagram.png b/command/etc/command-sequence-diagram.png new file mode 100644 index 000000000..845d0a2fd Binary files /dev/null and b/command/etc/command-sequence-diagram.png differ diff --git a/commander/README.md b/commander/README.md index 902c6af1b..cb5215296 100644 --- a/commander/README.md +++ b/commander/README.md @@ -33,6 +33,10 @@ In plain words > The Commander pattern turns a request into a stand-alone object, allowing for the parameterization of commands, queueing of actions, and the implementation of undo operations. +Sequence diagram + +![Commander sequence diagram](./etc/commander-sequence-diagram.png) + ## Programmatic Example of Commander Pattern in Java Managing transactions across different services in a distributed system, such as an e-commerce platform with separate `Payment` and `Shipping` microservices, requires careful coordination. Using the Commander pattern in Java for transaction coordination helps ensure data consistency and reliability, even when services experience partial failures. diff --git a/commander/etc/commander-sequence-diagram.png b/commander/etc/commander-sequence-diagram.png new file mode 100644 index 000000000..00d6eee07 Binary files /dev/null and b/commander/etc/commander-sequence-diagram.png differ diff --git a/component/README.md b/component/README.md index 638133265..6ab6284e2 100644 --- a/component/README.md +++ b/component/README.md @@ -30,6 +30,10 @@ In plain words > The component design pattern provides a single attribute to be accessible by numerous objects without requiring the existence of a relationship between the objects themselves. +Architecture diagram + +![Component architecture diagram](./etc/component-architecture-diagram.png) + ## Programmatic Example of Component Pattern in Java The `App` class creates a demonstration of the use of the component pattern by creating two different objects which inherit a small collection of individual components that are modifiable. diff --git a/component/etc/component-architecture-diagram.png b/component/etc/component-architecture-diagram.png new file mode 100644 index 000000000..8256d5719 Binary files /dev/null and b/component/etc/component-architecture-diagram.png differ diff --git a/composite-entity/README.md b/composite-entity/README.md index 9ac14d97e..5946663a8 100644 --- a/composite-entity/README.md +++ b/composite-entity/README.md @@ -36,6 +36,10 @@ Wikipedia says > Composite entity is a Java EE Software design pattern and it is used to model, represent, and manage a set of interrelated persistent objects rather than representing them as individual fine-grained entity beans, and also a composite entity bean represents a graph of objects. +Flowchart + +![Composite Entity flowchart](./etc/composite-entity-flowchart.png) + ## Programmatic Example of Composite Entity in Java For a console, there may be many interfaces that need to be managed and controlled. Using the composite entity pattern, dependent objects such as messages and signals can be combined and controlled using a single object. diff --git a/composite-entity/etc/composite-entity-flowchart.png b/composite-entity/etc/composite-entity-flowchart.png new file mode 100644 index 000000000..2954db2db Binary files /dev/null and b/composite-entity/etc/composite-entity-flowchart.png differ diff --git a/composite-view/README.md b/composite-view/README.md index bb2704eed..a670f00ff 100644 --- a/composite-view/README.md +++ b/composite-view/README.md @@ -29,6 +29,10 @@ Wikipedia says > Composite views that are composed of multiple atomic subviews. Each component of the template may be included dynamically into the whole and the layout of the page may be managed independently of the content. This solution provides for the creation of a composite view based on the inclusion and substitution of modular dynamic and static template fragments. It promotes the reuse of atomic portions of the view by encouraging modular design. +Flowchart + +![Composite View flowchart](./etc/composite-view-flowchart.png) + ## Programmatic Example of Composite View Pattern in Java A news site wants to display the current date and news to different users based on that user's preferences. The news site will substitute in different news feed components depending on the user's interest, defaulting to local news. diff --git a/composite-view/etc/composite-view-flowchart.png b/composite-view/etc/composite-view-flowchart.png new file mode 100644 index 000000000..bee1d8d9b Binary files /dev/null and b/composite-view/etc/composite-view-flowchart.png differ diff --git a/composite/README.md b/composite/README.md index 0dc740c3b..91f5e3230 100644 --- a/composite/README.md +++ b/composite/README.md @@ -34,6 +34,10 @@ Wikipedia says > In software engineering, the composite pattern is a partitioning design pattern. The composite pattern describes that a group of objects is to be treated in the same way as a single instance of an object. The intent of a composite is to "compose" objects into tree structures to represent part-whole hierarchies. Implementing the composite pattern lets clients treat individual objects and compositions uniformly. +Flowchart + +![Composite flowchart](./etc/composite-flowchart.png) + ## Programmatic Example of Composite Pattern in Java Every sentence is composed of words which are in turn composed of characters. Each of these objects are printable, and they can have something printed before or after them like sentence always ends with full stop and word always has space before it. diff --git a/composite/etc/composite-flowchart.png b/composite/etc/composite-flowchart.png new file mode 100644 index 000000000..7938250ec Binary files /dev/null and b/composite/etc/composite-flowchart.png differ diff --git a/context-object/README.md b/context-object/README.md index 831abb7c7..71e231681 100644 --- a/context-object/README.md +++ b/context-object/README.md @@ -36,6 +36,10 @@ In plain words > Use a Context Object to encapsulate state in a protocol-independent way to be shared throughout your application. +Sequence diagram + +![Context Object sequence diagram](./etc/context-object-sequence-diagram.png) + ## Programmatic Example of Context Object in Java In a multi-layered Java application, different layers such as A, B, and C extract specific information from a shared context. Passing each piece of information individually is inefficient. The Context Object pattern efficiently stores and passes this information, improving the overall performance and maintainability of the Java application. diff --git a/context-object/etc/context-object-sequence-diagram.png b/context-object/etc/context-object-sequence-diagram.png new file mode 100644 index 000000000..f8cc87ff3 Binary files /dev/null and b/context-object/etc/context-object-sequence-diagram.png differ diff --git a/converter/README.md b/converter/README.md index adf29383d..7fbb1fe9e 100644 --- a/converter/README.md +++ b/converter/README.md @@ -32,6 +32,10 @@ In plain words > The Converter Pattern simplifies mapping instances of one class to instances of another class, ensuring consistent and clean data transformation. +Sequence diagram + +![Converter sequence diagram](./etc/converter-sequence-diagram.png) + ## Programmatic Example of Converter Pattern in Java In applications, it's common for the database layer to have entities that need mapping to DTOs (Data Transfer Objects) for business logic. This mapping often involves many classes, necessitating a generic solution. diff --git a/converter/etc/converter-sequence-diagram.png b/converter/etc/converter-sequence-diagram.png new file mode 100644 index 000000000..65192915c Binary files /dev/null and b/converter/etc/converter-sequence-diagram.png differ diff --git a/curiously-recurring-template-pattern/README.md b/curiously-recurring-template-pattern/README.md index 0cf750504..e44bd7d53 100644 --- a/curiously-recurring-template-pattern/README.md +++ b/curiously-recurring-template-pattern/README.md @@ -40,6 +40,10 @@ Wikipedia says > The curiously recurring template pattern (CRTP) is an idiom, originally in C++, in which a class X derives from a class template instantiation using X itself as a template argument. +Flowchart + +![Curiously Recurring Template Pattern flowchart](./etc/crtp-flowchart.png) + ## Programmatic example of CRTP in Java For a mixed martial arts promotion that is planning an event, ensuring that the fights are organized between athletes of the same weight class is crucial. This prevents mismatches between fighters of significantly different sizes, such as a heavyweight facing off against a bantamweight. diff --git a/curiously-recurring-template-pattern/etc/crtp-flowchart.png b/curiously-recurring-template-pattern/etc/crtp-flowchart.png new file mode 100644 index 000000000..a205e1638 Binary files /dev/null and b/curiously-recurring-template-pattern/etc/crtp-flowchart.png differ diff --git a/currying/README.md b/currying/README.md index 22806a50d..b0e86856d 100644 --- a/currying/README.md +++ b/currying/README.md @@ -33,6 +33,10 @@ Wikipedia says > In mathematics and computer science, currying is the technique of translating a function that takes multiple arguments into a sequence of families of functions, each taking a single argument. +Sequence diagram + +![Currying sequence diagram](./etc/currying-sequence-diagram.png) + ## Programmatic example of Currying Pattern in Java Consider a librarian who wants to populate their library with books. The librarian wants functions which can create books corresponding to specific genres and authors. Currying makes this possible by writing a curried book builder function and utilising partial application. diff --git a/currying/etc/currying-sequence-diagram.png b/currying/etc/currying-sequence-diagram.png new file mode 100644 index 000000000..7c3300263 Binary files /dev/null and b/currying/etc/currying-sequence-diagram.png differ