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中,从開始的需求到终于设计类,类图也是环绕这三个层次的观点进 ...
随机推荐
- django之异常错误
现象:最近需要抓取一些网页的信息,但发现Python的乱码问题相对Java来说,不太一样.按照以往Java解决中文乱码问题的思路去解决Python乱码,貌似行不通,报错信息: SyntaxError: ...
- python之函数用法startswith()
# -*- coding: utf-8 -*- #python 27 #xiaodeng #python之函数用法startswith() #http://www.runoob.com/python/ ...
- 基于JavaWeb实现的研究室综合系统
代码地址如下:http://www.demodashi.com/demo/14641.html 概述 基于JavaWeb实现的研究室综合系统,功能包括研究室成员注册.登陆,后台管理,相册功能,新闻模块 ...
- java struts2入门学习---自定义类型转换
自定义类型转换器的作用就是将struts无法识别的类型转换成自己所需要的. 比如输入:广东-东莞-虎门,对应的输出时能输出:广东省 东莞市 虎门(镇/区) 这里涉及到的知识点即是将String转换为任 ...
- libev与libevent区别
摘自stackflow的回答,主要从架构上说明了二者的区别: As for design philosophy, libev was created to improve on some of the ...
- linux RPM包安装、更新、删除等操作命令简明总结, 如何查看yum安装的软件路径 ?
rpm -ivh package.rpm 安装一个rpm包rpm -ivh --nodeeps package.rpm 安装一个rpm包而忽略依赖关系警告rpm -U package.rpm 更新一个 ...
- java 实现二分法
http://www.cnblogs.com/vanezkw/archive/2012/06/29/2569470.html JDK里面的二分法实现.二分法的实现有多种今天就给大家分享两种.一种是递归 ...
- 【C#】C#项目如何获得项目的根目录
编写程序的时候,经常需要用的项目根目录.自己总结如下 1.取得控制台应用程序的根目录方法 方法1.Environment.CurrentDirectory 取得或设置当前工作目录的完整限定路径 ...
- .Net jsc.exe 编译js 成exe
- mysql密码过期问题
密码自动过期是mysql 5.7.4引入的新功能.由参数default_password_lifetime控制.从5.7.4到5.7.10,默认是360天.设置为0,即不开启密码过期设置. 取消某个用 ...