* #1771 Move translations to a new directory to have more organization * #1771 spanish translation * #1771 change the language codes to follow ISO 639-1 and change the links * #1771 remove country flags
layout, title, folder, permalink, categories, tags
layout | title | folder | permalink | categories | tags | |
---|---|---|---|---|---|---|
pattern | Factory Kit | factory-kit | /patterns/factory-kit/ | Creational |
|
含义
使用分离的构建器和工厂接口来定义一个不可变内容的工厂。
类图
适用场景
工厂套件模式适用于与以下场景:
- 一个类无法预知它需要创建的对象的类别
- 你只是想要一个新的自定义构建器(builder)的实例,而非全局的构建器
- 你明确地想要定义对象的类型,而且工厂可以创建这些对象
- 你想要分离构建器(builder)和创建器(creator)接口