From bee1a53faa2ee9b5375ea844b99d42f1cc5e755a Mon Sep 17 00:00:00 2001 From: Edward Date: Sat, 2 May 2020 17:36:50 +0800 Subject: [PATCH] order creation patterns --- README.md | 15 ++++++++------- creation/{25_new => 01_new}/REDME.md | 0 creation/{25_new => 01_new}/new_test.go | 0 .../README.md | 0 .../simple.go | 0 .../simple_test.go | 0 creation/{06_builder => 03_builder}/README.md | 0 creation/{06_builder => 03_builder}/builder.go | 0 .../{06_builder => 03_builder}/builder_test.go | 0 .../{24_object_pool => 04_object_pool}/README.md | 0 .../obejct_poo.go | 0 .../object_pool_test.go | 0 .../README.md | 0 .../factorymethod.go | 0 .../factorymethod_test.go | 0 creation/{03_singleton => 06_singleton}/README.md | 0 .../{03_singleton => 06_singleton}/singleton.go | 0 .../singleton_test.go | 0 .../README.md | 0 .../abstractfactory_db.go | 0 .../abstractfactory_robot.go | 0 .../abstractfactory_test.go | 0 22 files changed, 8 insertions(+), 7 deletions(-) rename creation/{25_new => 01_new}/REDME.md (100%) rename creation/{25_new => 01_new}/new_test.go (100%) rename creation/{00_simple_factory => 02_simple_factory}/README.md (100%) rename creation/{00_simple_factory => 02_simple_factory}/simple.go (100%) rename creation/{00_simple_factory => 02_simple_factory}/simple_test.go (100%) rename creation/{06_builder => 03_builder}/README.md (100%) rename creation/{06_builder => 03_builder}/builder.go (100%) rename creation/{06_builder => 03_builder}/builder_test.go (100%) rename creation/{24_object_pool => 04_object_pool}/README.md (100%) rename creation/{24_object_pool => 04_object_pool}/obejct_poo.go (100%) rename creation/{24_object_pool => 04_object_pool}/object_pool_test.go (100%) rename creation/{04_factory_method => 05_factory_method}/README.md (100%) rename creation/{04_factory_method => 05_factory_method}/factorymethod.go (100%) rename creation/{04_factory_method => 05_factory_method}/factorymethod_test.go (100%) rename creation/{03_singleton => 06_singleton}/README.md (100%) rename creation/{03_singleton => 06_singleton}/singleton.go (100%) rename creation/{03_singleton => 06_singleton}/singleton_test.go (100%) rename creation/{05_abstract_factory => 08_abstract_factory}/README.md (100%) rename creation/{05_abstract_factory => 08_abstract_factory}/abstractfactory_db.go (100%) rename creation/{05_abstract_factory => 08_abstract_factory}/abstractfactory_robot.go (100%) rename creation/{05_abstract_factory => 08_abstract_factory}/abstractfactory_test.go (100%) diff --git a/README.md b/README.md index 7289df9..c4d0897 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,15 @@ Go常用的、面向工程化和最佳实践的模式套路,包含常见的23 ## 创建型模式 -+ [x] [简单工厂模式(Simple Factory)](./creation/00_simple_factory) -+ [x] [工厂方法模式(Factory Method)](./creation/04_factory_method) -+ [x] [抽象工厂模式(Abstract Factory)](./creation/05_abstract_factory) -+ [x] [创建者模式(Builder)](./creation/06_builder) ++ [x] [New模式(New)](./creation/01_new) ++ [x] [简单工厂模式(Simple Factory)](./creation/02_simple_factory) ++ [x] [创建者模式(Builder)](./creation/03_builder) ++ [x] [单例模式(Singleton)](./creation/06_singleton) ++ [ ] [对象池模式(Object Pool)](./creation/04_object_pool) ++ [x] [工厂方法模式(Factory Method)](./creation/05_factory_method) ++ [x] [抽象工厂模式(Abstract Factory)](./creation/08_abstract_factory) + [x] [原型模式(Prototype)](./creation/07_prototype) -+ [x] [单例模式(Singleton)](./creation/03_singleton) -+ [ ] [对象池模式(Object Pool)](./creation/24_object_pool) -+ [x] [New模式(New)](./creation/25_new) + ## 结构型模式 diff --git a/creation/25_new/REDME.md b/creation/01_new/REDME.md similarity index 100% rename from creation/25_new/REDME.md rename to creation/01_new/REDME.md diff --git a/creation/25_new/new_test.go b/creation/01_new/new_test.go similarity index 100% rename from creation/25_new/new_test.go rename to creation/01_new/new_test.go diff --git a/creation/00_simple_factory/README.md b/creation/02_simple_factory/README.md similarity index 100% rename from creation/00_simple_factory/README.md rename to creation/02_simple_factory/README.md diff --git a/creation/00_simple_factory/simple.go b/creation/02_simple_factory/simple.go similarity index 100% rename from creation/00_simple_factory/simple.go rename to creation/02_simple_factory/simple.go diff --git a/creation/00_simple_factory/simple_test.go b/creation/02_simple_factory/simple_test.go similarity index 100% rename from creation/00_simple_factory/simple_test.go rename to creation/02_simple_factory/simple_test.go diff --git a/creation/06_builder/README.md b/creation/03_builder/README.md similarity index 100% rename from creation/06_builder/README.md rename to creation/03_builder/README.md diff --git a/creation/06_builder/builder.go b/creation/03_builder/builder.go similarity index 100% rename from creation/06_builder/builder.go rename to creation/03_builder/builder.go diff --git a/creation/06_builder/builder_test.go b/creation/03_builder/builder_test.go similarity index 100% rename from creation/06_builder/builder_test.go rename to creation/03_builder/builder_test.go diff --git a/creation/24_object_pool/README.md b/creation/04_object_pool/README.md similarity index 100% rename from creation/24_object_pool/README.md rename to creation/04_object_pool/README.md diff --git a/creation/24_object_pool/obejct_poo.go b/creation/04_object_pool/obejct_poo.go similarity index 100% rename from creation/24_object_pool/obejct_poo.go rename to creation/04_object_pool/obejct_poo.go diff --git a/creation/24_object_pool/object_pool_test.go b/creation/04_object_pool/object_pool_test.go similarity index 100% rename from creation/24_object_pool/object_pool_test.go rename to creation/04_object_pool/object_pool_test.go diff --git a/creation/04_factory_method/README.md b/creation/05_factory_method/README.md similarity index 100% rename from creation/04_factory_method/README.md rename to creation/05_factory_method/README.md diff --git a/creation/04_factory_method/factorymethod.go b/creation/05_factory_method/factorymethod.go similarity index 100% rename from creation/04_factory_method/factorymethod.go rename to creation/05_factory_method/factorymethod.go diff --git a/creation/04_factory_method/factorymethod_test.go b/creation/05_factory_method/factorymethod_test.go similarity index 100% rename from creation/04_factory_method/factorymethod_test.go rename to creation/05_factory_method/factorymethod_test.go diff --git a/creation/03_singleton/README.md b/creation/06_singleton/README.md similarity index 100% rename from creation/03_singleton/README.md rename to creation/06_singleton/README.md diff --git a/creation/03_singleton/singleton.go b/creation/06_singleton/singleton.go similarity index 100% rename from creation/03_singleton/singleton.go rename to creation/06_singleton/singleton.go diff --git a/creation/03_singleton/singleton_test.go b/creation/06_singleton/singleton_test.go similarity index 100% rename from creation/03_singleton/singleton_test.go rename to creation/06_singleton/singleton_test.go diff --git a/creation/05_abstract_factory/README.md b/creation/08_abstract_factory/README.md similarity index 100% rename from creation/05_abstract_factory/README.md rename to creation/08_abstract_factory/README.md diff --git a/creation/05_abstract_factory/abstractfactory_db.go b/creation/08_abstract_factory/abstractfactory_db.go similarity index 100% rename from creation/05_abstract_factory/abstractfactory_db.go rename to creation/08_abstract_factory/abstractfactory_db.go diff --git a/creation/05_abstract_factory/abstractfactory_robot.go b/creation/08_abstract_factory/abstractfactory_robot.go similarity index 100% rename from creation/05_abstract_factory/abstractfactory_robot.go rename to creation/08_abstract_factory/abstractfactory_robot.go diff --git a/creation/05_abstract_factory/abstractfactory_test.go b/creation/08_abstract_factory/abstractfactory_test.go similarity index 100% rename from creation/05_abstract_factory/abstractfactory_test.go rename to creation/08_abstract_factory/abstractfactory_test.go