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

@ -19,10 +19,10 @@ underlying representation.
## Explanation
Real world example
Real-world example
> Treasure chest contains a set of magical items. There multiple types of items such as rings,
> potions and weapons. The items can be browsed by type using an iterator the treasure chest
> potions, and weapons. The items can be browsed by type using an iterator the treasure chest
> provides.
In plain words
@ -113,7 +113,7 @@ public interface Iterator<T> {
}
```
In the following example we iterate through the ring type items found in the chest.
In the following example, we iterate through the ring-type items found in the chest.
```java
var itemIterator = TREASURE_CHEST.iterator(ItemType.RING);
@ -145,7 +145,7 @@ Use the Iterator pattern
* [How to Use Iterator?](http://www.tutorialspoint.com/java/java_using_iterator.htm)
## Real world examples
## Known uses
* [java.util.Iterator](http://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html)
* [java.util.Enumeration](http://docs.oracle.com/javase/8/docs/api/java/util/Enumeration.html)