UML简述
UML图是设计、实现或已经存在的系统模型的部分图形表示(视图)。UML图包含图形元素(符号)——与边缘连接的UML节点(也称为路径或流)——它们表示设计系统的UML模型中的元素。该系统的UML模型可能还包含其他文档,例如作为模板文本编写的用例。
UML规范并不排除混合不同类型的图表,例如,将结构和行为元素结合起来以显示嵌套在用例中的状态机。因此,各种图表之间的界限并不严格执行。同时,一些UML工具会限制可用图形元素的集合,这些图形元素可用于处理特定类型的图表。
UML 2.5图的分类
UML规范定义了两种主要的UML图: 结构图和行为图。
结构图:显示了系统及其各个部分在不同抽象层和实现层上的静态结构以及它们如何相互关联。结构图中的元素表示系统的有意义的概念,可能包括抽象的,真实的世界和实现概念。
行为图:显示了系统中对象的动态行为,可以将其描述为随着时间的推移对系统进行的一系列更改。
UML 2.5图可以按照如下所示进行分层次分类。请注意,以蓝色显示的项目不是官方UML 2.5分类图的一部分。
UML 2.5图表概述。
请注意,蓝色的项目不是UML 2.5图表的官方分类标准的一部分。
UML 2.5结构图
结构图并没有利用时间相关的概念,也没有显示动态行为的细节。但是,它们可能会显示与结构图中展示的分类器行为的关系。
类图(Class diagram)
将设计系统,子系统或组件的结构显示为相关类和接口,以及它们的特征,约束和关系 – 关联,泛化,依赖关系等。关键概念:类(Class),接口(interface),特性(feature),约束(constraint),关联(association),泛化(generalization),依赖(dependency)。
对象图对象图(Object diagram)
实例级的类图,它显示了类和接口(对象)的实例、有属性与值含义和关联关系(关联的实例)对象图在现在已经过时的UML 1.4.2规范中定义为“实例的图形,包括对象和数据值。静态对象图是类图的一个实例;它显示了一个系统在某个时间