UML的通用机制(三)
Common Divisions
In modeling object-oriented systems, the world often gets divided in several ways.
First, there is the division of class and object. A class is an abstraction; an object is one concrete manifestation of that abstraction. In the UML, you can model classes as well as objects, as shown
in Figure 2-19. Graphically, the UML distinguishes an object by using the same symbol as its class and then simply underlying the object’s
name.
In this figure, there is one class, namedCustomer, together
with three objects:Jan(which is marked explicitly as being aCustomerobject),
:Customer(an anonymous
Customer object), andElyse
(which in its specification is marked as being a kind ofCustomerobject,
although it’s not shown explicitly here).
Almost every building block in the UML has this same kind of class/object dichotomy. For example, you can have use cases and use case executions, component and component instances, nodes and node
instances, and so on.
Second, there is the separation of interface and implementation. An interface declares a contract, and an implementation represents one concrete realization of that contract, responsible for faithfully
carrying out the interface’s complete semantics. In the UML, you can model both interfaces and their implementations, as shown
in Figure2-20.
In this figure, there is one component namedSpellingWizard.dll
that provides (implements) two interfaces,IUnknown andISpelling.
It also requires an interface,IDictionary, that must be provided by another component.
Almost every building block in the UML has this same kind of interface/implementation dichotomy. For example, you can have use cases and the collaborations that realize them, as well as operations
and the methods that implement them.
Third, there is the separation of type and role. The type declares the class of an entity, such as an object, an attribute, or a parameter. A role describes the meaning of an entity within its context,
such as a class, component, or collaboration. Any entity that forms part of the structure of another entity, such as an attribute, has both characteristics: It derives some of its meaning from its inherent type and some of its meaning from its role within
its context(Figure 2-21).
通用划分
在构建面向对象的系统时。往往被划分为几个方面.
首先,有类和对象的划分.一个类是一个抽象的概念。而一个对象是抽象的详细表现形式.在UML中,你能够与构建类一样的构建对象,如图2-19所看到的.图形表现上。对象的图形表示与它的类一样。差别在于对象的名称下多了一条下划线.
在这个图中,有一个名为客户的类,三个对象:简(它被明白的标识为客户对象)。:客户(一个匿名客户对象)。和依丽丝(虽然在这里没有明白的显示,但它的格式已经告诉了我们它是一个客户对象).
在UML中差点儿全部的构建模块都有类和对象的区分.比如,实用例和运行用例,组件和组件实例,节点和节点实例等等.
其次,还有接口和实现的分离.一个接口仅仅定义声明。而实现则表现这个声明的详细实现,它负责如实地运行这个接口完整的语义.在UML中,你能够构建接口和他们的实现,如图2-20所看到的.
在这个图中,有一个名为SpellingWizard.dll的组件。它提供两个接口。IUnknown
和ISpelling. 还须要一个名为IDictionary的接口,这个接口必需由还有一个组件提供.
在UML中差点儿全部的构建模块都有接口和实现的区分.比如,实用例和实现这些用例的交互,也有操作和实现这些操作的方法.
第三,类型和角色的区分.类型定义一个实体类。如一个对象,一个属性,或是一个參数.角色描写叙述一个实体在上下文中的含义,如一个类,组件,或是交互.那些组成还有一个实体的结构部分的实体。如属性,它们有两个特征:它来源于它内部的部分含义及角色所描写叙述的上下文中的部分含义.如图2-21所看到的.
UML的通用机制(三)的更多相关文章
- 【UML 建模】UML建模语言入门-视图,事物,关系,通用机制
. 作者 :万境绝尘 转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/18964835 . 一. UML视图 1. Ration ...
- UML建模语言入门-视图,事物,关系,通用机制
. 作者 :万境绝尘 转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/18964835 . 一. UML视图 1. Ration ...
- 在UML系统开发中有三个主要的模型
http://www.cnblogs.com/Yogurshine/archive/2013/01/14/2859248.html 在UML系统开发中有三个主要的模型: 功能模型: 从用户的角度展示系 ...
- C++实现委托机制(三)——lambda表达式封装
C++.引言: 其实原本没打算写这一章的,不过最后想了想,嗯还是把lambda表达式也一并封装进去,让这个委托也适应lambda表达式的注册.不过在之前还是需要先了解lamb ...
- 再学UML-深入浅出UML类图(三)
类与类之间的关系(2) 2. 依赖关系 依赖(Dependency)关系是一种使用关系,特定事物的改变有可能会影响到使用该事物的其他事物,在需要表示一个事物使用另一个事物时使用依赖关系. ...
- NameNode元数据的管理机制(三)
元数据的管理: 第一步:客户端通过DistributedFilesystem 对象中的creat()方法来创建文件,此时,RPC会 通过一个RPC链接协议来调用namenode,并在命名空间中创建一个 ...
- UML类图(三)-------实例
实例分析1——登录模块 某基于C/S的即时聊天系统登录模块功能描述如下: 用户通过登录界面(LoginForm)输入账号和密码,系统将输入的账号和密码与存储在数据库(User)表中的用户信息进行比较, ...
- 《UML精粹》第三章 -类图的基本概念
第三章 类图:基本概念 类图可用来描写叙述系统中各种对象的类型.也可描绘出对象间各种各样的静态关系.此外.类图中也能够秀出类的性质(property)与操作(operation),以及可应用到对象间连 ...
- Thinking in UML 学习笔记(三)——UML核心视图之类图
类图的作用:用于展示系统中的类及其相互之间的关系. UML在解决面向对象的方法中对类理解为三个层次,各自是:概念层.说明层.实现层.在UML中,从開始的需求到终于设计类,类图也是环绕这三个层次的观点进 ...
随机推荐
- V-rep学习笔记:机器人模型创建3—搭建动力学模型
接着之前写的V-rep学习笔记:机器人模型创建2—添加关节继续机器人创建流程.如果已经添加好关节,那么就可以进入流程的最后一步:搭建层次结构模型和模型定义(build the model hierar ...
- python之模块ftplib(实现ftp上传下载代码)
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之模块ftplib(实现ftp上传下载代码) #需求:实现ftp上传下载代码(不含错误处理) f ...
- python之模块chunk,了解即可
# -*- coding: utf-8 -*-#python 27#xiaodeng#python之模块chunk# chunk模块专用于读取TIFF格式的文件,打开应当使用二进制模式 #TIFF:标 ...
- 在执行context.getContentResolver.query()方法时出现错误。
1. 在执行context.getContentResolver.query()方法时出现错误. 07-15 18:46:13.470: E/AndroidRuntime(13624): FATAL ...
- (原)InsightFace及其mxnet代码
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/8525287.html 论文 InsightFace : Additive Angular Margin ...
- RVM Ruby 管理工具
1.RVM 简介 1.1 Ruby 简介 Ruby 是一种面向对象的脚本语言,简单易用,功能强大.能跨平台和可移植性好等等.其实就是种脚本语言. Ruby 的软件源使用的是亚马逊的云服务,国内网络环境 ...
- App Icon Gear App 图标制作工具
1.App Icon Gear 简介 App Icon Gear(原名 AppIconMaker)不仅可以创建 App 图标.启动图 LaunchImage,还可以生成自定义尺寸的图标集(Image ...
- Redis 的安装与使用(单节点)
Redis 的安装与使用(单节点) 环境:CentOS 6.5 Redis 版本:redis-3.0 (考虑到Redis3.0 在集群和性能提升方面的特性,rc 版为正式版的候选版,而且 很快就出 ...
- javascript控件(一):一个好用的日历
一.官网 http://www.my97.net/ 二.引用 <script src="bower_components/My97DatePicker/WdatePicker.js&q ...
- keras 类似问题解决:model找不到,或者无法下载
Applications Keras Applications are deep learning models that are made available alongside pre-train ...