From 851aa0a0d8117a915d54cc83244e37648e4dc718 Mon Sep 17 00:00:00 2001 From: Dominik Liebler Date: Tue, 24 Sep 2013 13:31:37 +0200 Subject: [PATCH] README FactoryMethod --- FactoryMethod/FactoryMethod.php | 12 +----------- FactoryMethod/README.md | 11 +++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 FactoryMethod/README.md diff --git a/FactoryMethod/FactoryMethod.php b/FactoryMethod/FactoryMethod.php index 72357d5..677e6a6 100644 --- a/FactoryMethod/FactoryMethod.php +++ b/FactoryMethod/FactoryMethod.php @@ -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 { diff --git a/FactoryMethod/README.md b/FactoryMethod/README.md new file mode 100644 index 0000000..10af7fd --- /dev/null +++ b/FactoryMethod/README.md @@ -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.