您的位置:首页 > 其它

UML学习--class diagram

2008-08-30 20:29 141 查看
http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/ http://atlas.kennesaw.edu/~dbraun/csis4650/A&D/UML_tutorial/class.htm class diagram用于描述对象的类型以及它们之间的关系。
一个class diagram分为三部分:类名,变量和函数。





继承
从子类指向基类的带有空心箭头的实线。图中,BankAccountwithdrawal(amount:Dollars)使用斜体表示序类和虚函数。



关联(association)

双向关联(默认)
两个都知道它们之间的关系



上图表示一个flight最多有一个plane,而一个plane可以分配给0~无穷多个flight。实线旁的数字被称为Multiplicity values。
IndicatorMeaning
0..1 Zero or one
1One only
0..*Zero or more
* Zero or more
1..*One or more
3Three only
0..5Zero to Five
5..15 Five to Fifteen
单向关联(Uni-directional association
只有一个类知道这种关系。箭头指向不知道这种关系的类。



可见性(visibility)
MarkVisibility type
+Public
# Protected
- Private
~Package
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: