task: Explanations and grammar fixes for all the GoF patterns (#1791)

* Grammatical fixes to command pattern

* Update bridge pattern readme

* Fixes to builder pattern grammar

* Update chain of responsibility

* Improvements to the composite example

* Fixes to headings

* Minor updates to decorator pattern

* Update facade

* Update factory example

* Update factory method

* Update flyweight

* Interpreter explanation

* Update iterator readme

* Add explanation for mediator pattern

* Grammatical fixes to memento

* Grammar fixes for observer

* Update explanation for the prototype pattern

* Proxy pattern grammar fixes

* Update singleton

* Grammar fixes to state pattern

* Grammar fixes for strategy

* Grammar fixes, template method

* Grammar fixes for visitor

* Fix typo
This commit is contained in:
Ilkka Seppälä
2021-06-24 15:57:20 +03:00
committed by GitHub
parent bbdff14a66
commit 04bf566dc1
66 changed files with 872 additions and 357 deletions

View File

@ -20,10 +20,10 @@ object can be restored to this state later.
## Explanation
Real world example
Real-world example
> We are working on astrology application where we need to analyze star properties over time. We are
> creating snapshots of star state using Memento pattern.
> We are working on an astrology application where we need to analyze star properties over time. We
> are creating snapshots of star states using the Memento pattern.
In plain words
@ -51,7 +51,7 @@ public enum StarType {
```
Next, let's jump straight to the essentials. Here's the `Star` class along with the mementos that we
need manipulate. Especially pay attention to `getMemento` and `setMemento` methods.
need to manipulate. Especially pay attention to `getMemento` and `setMemento` methods.
```java
public interface StarMemento {
@ -176,7 +176,7 @@ Use the Memento pattern when
* A direct interface to obtaining the state would expose implementation details and break the
object's encapsulation
## Real world examples
## Known uses
* [java.util.Date](http://docs.oracle.com/javase/8/docs/api/java/util/Date.html)