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:
Binary file not shown.
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 29 KiB |
@ -5,31 +5,32 @@ package com.iluwatar.factory {
|
||||
+ App()
|
||||
+ main(args : String[]) {static}
|
||||
}
|
||||
interface Car {
|
||||
interface Coin {
|
||||
+ getDescription() : String {abstract}
|
||||
}
|
||||
class CarsFactory {
|
||||
+ CarsFactory()
|
||||
+ getCar(type : CarType) : Car {static}
|
||||
class CoinFactory {
|
||||
+ CoinFactory()
|
||||
+ getCoin(type : CoinType) : Coin {static}
|
||||
}
|
||||
~enum CarType {
|
||||
+ FERRARI {static}
|
||||
+ FORD {static}
|
||||
+ valueOf(name : String) : CarType {static}
|
||||
+ values() : CarType[] {static}
|
||||
enum CoinType {
|
||||
+ COPPER {static}
|
||||
+ GOLD {static}
|
||||
- constructor : Supplier<Coin>
|
||||
+ getConstructor() : Supplier<Coin>
|
||||
+ valueOf(name : String) : CoinType {static}
|
||||
+ values() : CoinType[] {static}
|
||||
}
|
||||
class Ferrari {
|
||||
class CopperCoin {
|
||||
~ DESCRIPTION : String {static}
|
||||
+ Ferrari()
|
||||
+ CopperCoin()
|
||||
+ getDescription() : String
|
||||
}
|
||||
class Ford {
|
||||
class GoldCoin {
|
||||
~ DESCRIPTION : String {static}
|
||||
+ Ford()
|
||||
+ GoldCoin()
|
||||
+ getDescription() : String
|
||||
}
|
||||
}
|
||||
CarType ..+ CarsFactory
|
||||
Ferrari ..|> Car
|
||||
Ford ..|> Car
|
||||
CopperCoin ..|> Coin
|
||||
GoldCoin ..|> Coin
|
||||
@enduml
|
Reference in New Issue
Block a user