* add state and callback pattern * add command and template-method pattern * add iterator pattern * add bridege and DI pattern * fix issue #1600 * add converter,proxy,visitor pattern * add caching,composite,delegation,dirty-flag,interpreter patterns * add dao and producer-consumer * add dto and provate class data pattern * fix #1646 png path problems * fix #1646 composite png path case problem * add abstract document pattern and version-number pattern * add ambassador pattern * add acyclic-visitor and api-gateway pattern * add abstract-factory pattern * add active-object pattern * add aggregator-microservices and arrange-act-assert pattern * update async-method-invocation pattern * add balking and business-delegate pattern * add bytecode and circuit-break pattern * update arrange/act/assert pattern problems * add csch pattern * add language code, correct pic path * #1805 update permalink Co-authored-by: Subhrodip Mohanta <subhrodipmohanta@gmail.com> Co-authored-by: Mike <admin@xiaod.info> Co-authored-by: Ilkka Seppälä <iluwatar@users.noreply.github.com>
28 lines
786 B
Markdown
28 lines
786 B
Markdown
---
|
|
layout: pattern
|
|
title: Factory Kit
|
|
folder: factory-kit
|
|
permalink: /patterns/factory-kit/
|
|
categories: Creational
|
|
language: zh
|
|
tags:
|
|
- Extensibility
|
|
---
|
|
|
|
## 含义
|
|
使用分离的构建器和工厂接口来定义一个不可变内容的工厂。
|
|
|
|
## 类图
|
|

|
|
|
|
## 适用场景
|
|
工厂套件模式适用于与以下场景:
|
|
|
|
* 一个类无法预知它需要创建的对象的类别
|
|
- 你只是想要一个新的自定义构建器(builder)的实例,而非全局的构建器
|
|
- 你明确地想要定义对象的类型,而且工厂可以创建这些对象
|
|
- 你想要分离构建器(builder)和创建器(creator)接口
|
|
|
|
## 引用
|
|
|
|
* [Design Pattern Reloaded by Remi Forax: ](https://www.youtube.com/watch?v=-k2X7guaArU) |