抽象工厂模式结构类图
时间: 2023-11-30 09:42:41 浏览: 84
抽象工厂模式
以下是抽象工厂模式的结构类图:
```
+---------------------+
| AbstractFactory |
+---------------------+
| createProductA() |
| createProductB() |
+---------------------+
/\
|
|
+-----------------------+
| Factory1 |
+-----------------------+
| createProductA() |
| createProductB() |
+-----------------------+
/\
|
|
+-----------------------+
| Factory2 |
+-----------------------+
| createProductA() |
| createProductB() |
+-----------------------+
/\
|
|
+---------------------+
| AbstractProductA |
+---------------------+
| operationA() |
+---------------------+
/\
|
|
+---------------------+
| AbstractProductB |
+---------------------+
| operationB() |
+---------------------+
/\
|
|
+-----------------------+
| ProductA1 |
+-----------------------+
| operationA() |
+-----------------------+
/\
|
|
+-----------------------+
| ProductA2 |
+-----------------------+
| operationA() |
+-----------------------+
/\
|
|
+-----------------------+
| ProductB1 |
+-----------------------+
| operationB() |
+-----------------------+
/\
|
|
+-----------------------+
| ProductB2 |
+-----------------------+
| operationB() |
+-----------------------+
```
阅读全文