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中,从開始的需求到终于设计类,类图也是环绕这三个层次的观点进 ...
随机推荐
- pycharm安装提示 module 'pip' has no attribute 'main'
问题描述: 环境: windows10 pycharm2016.2.3 //在最先版本的pycharm就没问题,可能还需要升级pip版本 python3.6 pip安装模块,提示 Attribute ...
- Win7 64bit下值得推荐的免费看图软件
自从更换到Win7 64bit后, 用了十多年的AcdSee3.x不能再正常工作了. 找到了两个替代品: Faststone Image Viewer 和 XnView Faststone Image ...
- Dockerfile 构建后端tomcat应用并用shell脚本实现jenkins自动构建
Dockerfile 文件构建docker镜像 FROM centos MAINTAINER zhaoweifeng "zh******tech.cn" ENV LANG en_U ...
- 调试std::string
首先需要了解std::string的实现原理 string是STL中最为常用的类型,它是模板类basic_string用char类型特化后的结果,下面我们来看一下string类型的基本组成: t ...
- SqlServer安装时的选项说明
转自:https://blog.csdn.net/m0_37154839/article/details/80233446 看看组件的功能说明吧 服务器组件 说明 SQL Server 数据库引擎 S ...
- linux shell 脚本攻略学习17--正则表达式入门
正则表达式(也称为“regex”或“regexp”)是一种用来描述文本模式的特殊语法.在 Linux 系统上,正则表达式通常被用来查找文本的模式,以及对文本流执行“搜索-替换”操作以及其它功能. 正则 ...
- 如何搜索IP的地理位置
如何搜索IP的地理位置 http://www.ip138.com/ 打开上边这个网页以后,会显示自身的IP及地理位置,,,,也可以搜索别人的IP和地理位置,手机号等:截图如下:
- nfs的优化
总结和测试了一下自己的经验: NFS中的rsize.wsize rsize.wsize对于NFS的效能有很大的影响.wsize和rsize设定了SERVER和CLIENT之间往来数据块的大小,这两个参 ...
- C语言stat()函数:获取文件状态
相关函数:fstat, lstat, chmod, chown, readlink, utime 头文件:#include<sys/stat.h> #include<uninstd ...
- Ubuntu菜鸟入门(十四)—— 设置root密码
sudo su - 输入你的账户的密码 passwd 输入新的root密码 再次输入新的root密码