Skip to content

Commit 4d1505c

Browse files
committed
docs(factory-method): add class diagram section and normalize sequence diagram heading (#3366)
1 parent ede37bd commit 4d1505c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

factory-method/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@ Wikipedia says
3636

3737
> 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.
3838
39-
Sequence diagram
39+
## Sequence diagram
4040

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

43+
## Class diagram
44+
45+
![Factory Method class diagram](./etc/factory-method.urm.png)
46+
4347
## Programmatic Example of Factory Method Pattern in Java
4448

4549
The Factory Method approach is pivotal in Java Design Patterns for achieving flexible and maintainable code as we see in the following example.

0 commit comments

Comments
 (0)