mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-30 16:19:43 +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:
@@ -36,6 +36,10 @@ Wikipedia says
|
||||
|
||||
> In class-based programming, the factory method pattern is a creational pattern that uses factory methods to deal with the problem of creating objects without having to specify the exact class of the object that will be created. This is done by creating objects by calling a factory method — either specified in an interface and implemented by child classes, or implemented in a base class and optionally overridden by derived classes—rather than by calling a constructor.
|
||||
|
||||
Sequence diagram
|
||||
|
||||

|
||||
|
||||
## Programmatic Example of Factory Method Pattern in Java
|
||||
|
||||
The Factory Method approach is pivotal in Java Design Patterns for achieving flexible and maintainable code as we see in the following example.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
Reference in New Issue
Block a user