Skip to content

Commit

Permalink
add readme for factory method
Browse files Browse the repository at this point in the history
  • Loading branch information
saadati944 committed Apr 25, 2021
1 parent 4503559 commit 99d895b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Also if you know another algorithm or data structure that was not in here, creat
- [Creational patterns](./design_patterns/creational_patterns)
- [Abstract factory pattern](./design_patterns/creational_patterns/abstract_factory_pattern)
- [Builder pattern](./design_patterns/creational_patterns/builder_pattern)
- [Builder pattern](./design_patterns/creational_patterns/factory_method)

# Contributing

Expand Down
7 changes: 7 additions & 0 deletions design_patterns/creational_patterns/factory_method/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Factory method

![factory1](https://upload.wikimedia.org/wikipedia/commons/4/43/W3sDesign_Factory_Method_Design_Pattern_UML.jpg)

[read more in wikipedia](https://en.wikipedia.org/wiki/Factory_method_pattern)

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.

0 comments on commit 99d895b

Please sign in to comment.