RSS

Chapter II – UML Class Diagram II

03 Jun

UML Class Diagram Introduction II

4)关系

lDependency (绑定依赖(Binding),实现依赖(Realization),使用依赖(Usage),抽象依赖(Abstraction),授权依赖(Permission))

lAssociate (关联名,角色,导航性,多重性,构造型,聚合,组合)

lGeneralization (extends)

lRealization (implements)

Note: A 依赖B,那么A—->B,代码里,A中需要使用到B,可以是方法参数,可以是方法里面的变量,可以是类属性等。如果A关联B,那么类图A类中不列出B作为属性,可以通过类ARalations标签看到相关信息。导航性可以是单向也可以是双向的。
How to create a Dependency?
How to add Associate Name?

How to add Direct Navigation in Code?

How to add Indirect Navigation in Code?

How to customize your toolkit?

How to add Associate Name?

How to add Bi-directional Association and how does code implements it?
How to add Role Name?

How to add 2 Associations to a Class?

How to add “multiplic” to a Class and how to implement it in code?
NOTE: Navigable checkbox here, we usually check both Navigable checkboxes among 2 Class. This will simulate “Bi-directional Association”. Of course you can use “Association” instead of “Unidirectional Association” to implement “Bi-directional Association”. “Navigable” means be pointed.
How to replace 2 Associations with “multiplic”?

How to implement Tree Structure?

How to draw Aggregate?

This can be implemented by checking “Aggregate” checkbox in Association/Unidirectional Association specification.
How to draw Compose?

Make sure, in Aggregate Specification Tag, check “By Value” radio box. There is no icon in toolkit. How to draw Generalization?

How to draw Realization?

关于Class Diagram的其他话题

1)正向工程、逆向工程

l正向工程:UML图形生成JAVA代码

l逆向工程:JAVA代码生成UML图形

l不要依赖正向工程,逆向工程!这仅是一种辅助手段。

l画图的目的不是为了生成代码!

l写代码的目的也不是为了生成图形!

2)MDA

l模型驱动架构

lPlatform Independent Models (PIMs)Platform Specific Models (PSMs)

lMOF – (UML > 元模型 > 元模型)

3)什么时候使用类图?

l类图是UML最重要的图形

l不要使用类图来描述所有的细节

l保持类图的简单

l对概念建模(领域模型)

l分析类图

u实体类(领域模型)

u控制类

u边界类

4)领域模型

l领域模型是OO分析中最重要的和经典模型

l领域模型(Domain Model),也称为概念模型,领域对象模型,分析对象模型,我们在对项目进行分析的时候,往往会创建相应的领域模型。

l领域模型包括:概念,关联,属性

Advertisements
 
Leave a comment

Posted by on 06/03/2010 in UML

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: