余林颖 068fa0371e
docs: Translate some of the README docs into Chinese (#1744)
* docs: translated docs to zh

* docs: translated doc of sharding pattern to Chinese

* docs: translated doc of factory pattern to Chinese

* docs: translated doc of factory-kit pattern to Chinese

Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
2021-05-06 23:27:16 +05:30
..

layout, title, folder, permalink, categories, tags
layout title folder permalink categories tags
pattern Factory Kit factory-kit /patterns/factory-kit/ Creational
Extensibility

含义

使用分离的构建器和工厂接口来定义一个不可变内容的工厂。

类图

alt text

适用场景

工厂套件模式适用于与以下场景:

  • 一个类无法预知它需要创建的对象的类别
  • 你只是想要一个新的自定义构建器(builder)的实例,而非全局的构建器
  • 你明确地想要定义对象的类型,而且工厂可以创建这些对象
  • 你想要分离构建器(builder)和创建器(creator)接口

引用