mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-09-02 14:20:28 +00:00
docs: add diagrams for facade, factory kit, factory method, factory, fan-out/fan-in, feature toggle, filterer, fluent interface, flyweight, front controller, function composition
This commit is contained in:
@@ -26,6 +26,10 @@ Wikipedia says
|
||||
|
||||
> Factory is an object for creating other objects – formally a factory is a function or method that returns objects of a varying prototype or class.
|
||||
|
||||
Sequence diagram
|
||||
|
||||

|
||||
|
||||
## Programmatic Example of Factory Pattern in Java
|
||||
|
||||
Imagine an alchemist who is about to manufacture coins. The alchemist must be able to create both gold and copper coins and switching between them must be possible without modifying the existing source code. The factory pattern makes it possible by providing a static construction method which can be called with relevant parameters.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Reference in New Issue
Block a user