mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-06-05 04:13:49 +00:00
docs: builder, business-delegate, bytecode, caching, callback, chain diagrams
This commit is contained in:
+4
-4
@@ -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
|
||||
|
||||

|
||||
|
||||
## 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
|
||||
|
||||

|
||||
|
||||
## When to Use the Builder Pattern in Java
|
||||
|
||||
Use the Builder pattern when
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
Reference in New Issue
Block a user