Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion factory-method/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ 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
## Sequence diagram

![Factory Method sequence diagram](./etc/factory-method-sequence-diagram.png)

## Class diagram

![Factory Method class diagram](./etc/factory-method.urm.png)

## 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.
Expand Down
Loading