README FactoryMethod

This commit is contained in:
Dominik Liebler 2013-09-24 13:31:37 +02:00
parent d618d2068a
commit 851aa0a0d8
2 changed files with 12 additions and 11 deletions

View File

@ -3,17 +3,7 @@
namespace DesignPatterns\FactoryMethod;
/**
* FactoryMethod is a factory method. The good point over the SimpleFactory
* is you can subclass it to implement different way to create vehicle for
* each country (see subclasses)
*
* For simple case, this abstract class could be just an interface
*
* This pattern is a "real" Design Pattern because it achieves the
* "Dependency Inversion Principle" a.k.a the "D" in S.O.L.I.D principles.
*
* It means the FactoryMethod class depends on abstractions not concrete classes.
* This is the real trick compared to SImpleFactory or StaticFactory.
* class FactoryMethod
*/
abstract class FactoryMethod
{

11
FactoryMethod/README.md Normal file
View File

@ -0,0 +1,11 @@
# Factory Method
## Purpose
The good point over the SimpleFactory is you can subclass it to implement different ways to create objects
For simple case, this abstract class could be just an interface
This pattern is a "real" Design Pattern because it achieves the "Dependency Inversion Principle" a.k.a the "D" in S.O.L.I.D principles.
It means the FactoryMethod class depends on abstractions, not concrete classes. This is the real trick compared to SimpleFactory or StaticFactory.