1.1. 初识uml
为什么要学习uml?
像 设计模式
很多 类 方法 属性
,直接阅读需要消耗 大量
的时间来理解。
为了更 快速
全面
的阅读和 理解
,有必要学习 uml
。
我后续代码也会用 uml
来画。
uml示例解读
这是设计模式 - 抽象工厂模式的 uml
,以这个为例。
I Product 这个i代表interface
m calculatePrice() m代表method 方法
虚线实体三角符号 代表实现
C ShippableProduct C代表class 类
f 锁 productPrice f不知道 锁代表private 私有
.... (都是一样的)
C ProductFactory C代表class 类
C 开锁 SHIPPING_COSTS C代表const 开锁代表public
.... (都是一样的)