Fixes to builder pattern grammar

This commit is contained in:
Ilkka Seppälä 2021-06-12 18:49:40 +03:00
parent e361223def
commit 0f9f3b90c2
No known key found for this signature in database
GPG Key ID: 31B7C8F5CC412ECB

View File

@ -16,11 +16,11 @@ process can create different representations.
## Explanation
Real world example
Real-world example
> Imagine a character generator for a role-playing game. The easiest option is to let the computer
> create the character for you. If you want to manually select the character details like
> profession, gender, hair color etc. the character generation becomes a step-by-step process that
> profession, gender, hair color, etc. the character generation becomes a step-by-step process that
> completes when all the selections are ready.
In plain words
@ -49,7 +49,7 @@ anti-pattern.
**Programmatic Example**
The sane alternative is to use the Builder pattern. First of all we have our hero that we want to
The sane alternative is to use the Builder pattern. First of all, we have our hero that we want to
create:
```java
@ -134,7 +134,7 @@ Use the Builder pattern when
* The algorithm for creating a complex object should be independent of the parts that make up the object and how they're assembled
* The construction process must allow different representations for the object that's constructed
## Real world examples
## Real-world examples
* [java.lang.StringBuilder](http://docs.oracle.com/javase/8/docs/api/java/lang/StringBuilder.html)
* [java.nio.ByteBuffer](http://docs.oracle.com/javase/8/docs/api/java/nio/ByteBuffer.html#put-byte-) as well as similar buffers such as FloatBuffer, IntBuffer and so on.