docs: Strangler explanation (#2969)

* fix step builder docs

* add strangler docs
This commit is contained in:
Ilkka Seppälä
2024-05-21 16:40:28 +03:00
committed by GitHub
parent 0b79e5a9b9
commit 7bf1e36e5d
4 changed files with 150 additions and 28 deletions
+1 -11
View File
@@ -33,20 +33,10 @@ Wikipedia says
> The Step Builder pattern is a variation of the Builder design pattern, designed to provide a flexible solution for constructing complex objects step-by-step. This pattern is particularly useful when an object requires multiple initialization steps, which can be done incrementally to ensure clarity and flexibility in the creation process.
## Programmatic Example
Sure, let's create a programmatic example of the Step Builder design pattern using the code from the `step-builder` module.
## Step Builder Design Pattern
**Programmatic Example**
The Step Builder pattern is an extension of the Builder pattern that guides the user through the creation of an object in a step-by-step manner. This pattern improves the user experience by only showing the next step methods available, and not showing the build method until it's the right time to build the object.
### Class Diagram
![Step Builder](./etc/step-builder.png "Step Builder")
### Code Example
Let's consider a `Character` class that has many attributes such as `name`, `fighterClass`, `wizardClass`, `weapon`, `spell`, and `abilities`.
```java