docs: builder, business-delegate, bytecode, caching, callback, chain diagrams

This commit is contained in:
Ilkka Seppälä
2025-04-06 09:00:19 +03:00
parent 25f7bc6fea
commit d5a46be3c5
12 changed files with 25 additions and 12 deletions
+4 -4
View File
@@ -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
Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB