Skip to content

Commit bb31a13

Browse files
authored
add source code :octocat:
1 parent 5cf8011 commit bb31a13

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

FactoryMethod/Readme.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p align="center"><img src="https://dilrukperera.files.wordpress.com/2012/08/normalfac.jpg"></p>
22

33

4-
### Discussion
4+
### Discussion :open_hands:
55

66

77
Factory Method is to creating objects as Template Method is to implementing an algorithm. A superclass specifies all standard and generic behavior (using pure virtual "placeholders" for creation steps), and then delegates the creation details to subclasses that are supplied by the client.
@@ -14,7 +14,7 @@ Factory Method is similar to Abstract Factory but without the emphasis on famili
1414

1515
Factory Methods are routinely specified by an architectural framework, and then implemented by the user of the framework.
1616

17-
### Structure
17+
### Structure :foggy:
1818

1919
The implementation of Factory Method discussed in the Gang of Four (below) largely overlaps with that of Abstract Factory. For that reason, the presentation in this chapter focuses on the approach that has become popular since.
2020
<p align="center"><img src="https://sourcemaking.com/files/v2/content/patterns/Factory_Method.svg"></p>
@@ -28,7 +28,10 @@ The client is totally decoupled from the implementation details of derived class
2828

2929
<p align="center"><img src="https://sourcemaking.com/files/v2/content/patterns/Factory_Method__.svg"></p>
3030

31-
### Example
31+
### Example :squirrel:
3232

3333
The Factory Method defines an interface for creating objects, but lets subclasses decide which classes to instantiate. Injection molding presses demonstrate this pattern. Manufacturers of plastic toys process plastic molding powder, and inject the plastic into molds of the desired shapes. The class of toy (car, action figure, etc.) is determined by the mold.
3434
<p align="center"><img src="https://sourcemaking.com/files/v2/content/patterns/Factory_Method_example1.svg"></p>
35+
36+
37+
* Implementation code <a href="https://github.com/VanHakobyan/DesignPatterns/tree/master/FactoryMethod/FactoryMethod">her</a> :octocat:

0 commit comments

Comments
 (0)