Skip to content

Commit d5a46be

Browse files
committed
docs: builder, business-delegate, bytecode, caching, callback, chain diagrams
1 parent 25f7bc6 commit d5a46be

12 files changed

Lines changed: 25 additions & 12 deletions

File tree

builder/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public Hero(Profession profession,String name,HairType hairType,HairColor hairCo
4040

4141
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.
4242

43+
Sequence diagram
44+
45+
![Builder sequence diagram](./etc/builder-sequence-diagram.png)
46+
4347
## Programmatic Example of Builder Pattern in Java
4448

4549
In this Java Builder pattern example, we construct different types of `Hero` objects with varying attributes.
@@ -146,10 +150,6 @@ Program output:
146150
16:28:06.060 [main] INFO com.iluwatar.builder.App -- This is a thief named Desmond with bald head and wielding a bow.
147151
```
148152

149-
## Builder Pattern Class Diagram
150-
151-
![Builder](./etc/builder.urm.png "Builder class diagram")
152-
153153
## When to Use the Builder Pattern in Java
154154

155155
Use the Builder pattern when
51.1 KB
Loading

business-delegate/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Wikipedia says
3636

3737
> 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.
3838
39+
Sequence diagram
40+
41+
![Business Delegate sequence diagram](./etc/business-delegate-sequence-diagram.png)
42+
3943
## Programmatic Example of Business Delegate Pattern in Java
4044

4145
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.
145149
21:15:33.794 [main] INFO com.iluwatar.business.delegate.YouTubeService - YouTubeService is now processing
146150
```
147151

148-
## Business Delegate Pattern Class Diagram
149-
150-
![Business Delegate](./etc/business-delegate.urm.png "Business Delegate")
151-
152152
## When to Use the Business Delegate Pattern in Java
153153

154154
Use the Business Delegate pattern when
57.5 KB
Loading

bytecode/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ In plain words
3131

3232
> 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.
3333
34+
Sequence diagram
35+
36+
![Bytecode sequence diagram](./etc/bytecode-sequence-diagram.png)
37+
3438
## Programmatic Example of Bytecode Pattern in Java
3539

3640
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.
23 KB
Loading

caching/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ Wikipedia says
3434

3535
> 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.
3636
37+
Flowchart
38+
39+
![Caching flowchart](./etc/caching-flowchart.png)
40+
3741
## Programmatic Example of Caching Pattern in Java
3842

3943
In this programmatic example, we demonstrate different Java caching strategies, including write-through, write-around, and write-behind, using a user account management system.

caching/etc/caching-flowchart.png

44.4 KB
Loading

callback/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ Wikipedia says
3737

3838
> 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.
3939
40+
Sequence diagram
41+
42+
![Callback sequence diagram](./etc/callback-sequence-diagram.png)
43+
44+
4045
## Programmatic Example of Callback Pattern in Java
4146

4247
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.
40.6 KB
Loading

0 commit comments

Comments
 (0)