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的通用机制(三)的更多相关文章

  1. 【UML 建模】UML建模语言入门-视图,事物,关系,通用机制

    . 作者 :万境绝尘  转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/18964835 . 一. UML视图 1. Ration ...

  2. UML建模语言入门-视图,事物,关系,通用机制

    . 作者 :万境绝尘  转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/18964835 . 一. UML视图 1. Ration ...

  3. 在UML系统开发中有三个主要的模型

    http://www.cnblogs.com/Yogurshine/archive/2013/01/14/2859248.html 在UML系统开发中有三个主要的模型: 功能模型: 从用户的角度展示系 ...

  4. C++实现委托机制(三)——lambda表达式封装

    C++.引言:              其实原本没打算写这一章的,不过最后想了想,嗯还是把lambda表达式也一并封装进去,让这个委托也适应lambda表达式的注册.不过在之前还是需要先了解lamb ...

  5. 再学UML-深入浅出UML类图(三)

    类与类之间的关系(2)       2. 依赖关系  依赖(Dependency)关系是一种使用关系,特定事物的改变有可能会影响到使用该事物的其他事物,在需要表示一个事物使用另一个事物时使用依赖关系. ...

  6. NameNode元数据的管理机制(三)

    元数据的管理: 第一步:客户端通过DistributedFilesystem 对象中的creat()方法来创建文件,此时,RPC会 通过一个RPC链接协议来调用namenode,并在命名空间中创建一个 ...

  7. UML类图(三)-------实例

    实例分析1——登录模块 某基于C/S的即时聊天系统登录模块功能描述如下: 用户通过登录界面(LoginForm)输入账号和密码,系统将输入的账号和密码与存储在数据库(User)表中的用户信息进行比较, ...

  8. 《UML精粹》第三章 -类图的基本概念

    第三章 类图:基本概念 类图可用来描写叙述系统中各种对象的类型.也可描绘出对象间各种各样的静态关系.此外.类图中也能够秀出类的性质(property)与操作(operation),以及可应用到对象间连 ...

  9. Thinking in UML 学习笔记(三)——UML核心视图之类图

    类图的作用:用于展示系统中的类及其相互之间的关系. UML在解决面向对象的方法中对类理解为三个层次,各自是:概念层.说明层.实现层.在UML中,从開始的需求到终于设计类,类图也是环绕这三个层次的观点进 ...

随机推荐

  1. 关于java线程的daemon的认识

    在 JAVA中的CountDownLatch.CyclicBarrier.Semaphore的简单测试 这文章里说到了线程的daemon问题,特写一篇来分析一下. 上代码: package com.y ...

  2. django之异常错误

    现象:最近需要抓取一些网页的信息,但发现Python的乱码问题相对Java来说,不太一样.按照以往Java解决中文乱码问题的思路去解决Python乱码,貌似行不通,报错信息: SyntaxError: ...

  3. python模块之lib2to3(py2转py3自动化工具)

    # -*- coding: utf-8 -*- #python 27 #xiaodeng #python模块之lib2to3(py2转py3自动化工具) #http://tieba.baidu.com ...

  4. rabbitmq重装依赖的erlang 要注意

    今天安装的erlang和rabbitmq版本不匹配导致出现各种问题,在使用正确版本安装后出现问题,在日志中找到报错信息: {"init terminating in do_boot" ...

  5. Kafka 配置

    安装 解压放到/opt/kafka, 软链一个latest出来, 先要启动zookeeper. 可以使用独立的zookeeper服务, 也可以用kafka自带的, 在lib目录下带了zookeeper ...

  6. html模板实现银幕滚动效果<marquee>标签使用

    该标签不是HTML3.2的一部分,并且只支持MSIE3以后内核,所以如果你使用非IE内核浏览器(如:Netscape)可能无法看到下面一些很有意思的效果该标签是个容器标签语法: <marquee ...

  7. 【mysql】数据库Schema的优化

    由于MySQL数据库是基于行(Row)存储的数据库,而数据库操作 IO 的时候是以 page(block)的方式,也就是说,如果我们每条记录所占用的空间量减小,就会使每个page中可存放的数据行数增大 ...

  8. CocoaAsyncSocket UDP发送数据超过包大小限制(Message too long)

    最近在做iOS上,基于UDP传输音视频时遇到的一个问题,这边纪录一下: 由于考虑实时性比较高,所以采用了 CocoaAsyncSocket 的UDP框架来实现,将视频切割成一帧帧的图片发给服务端,不过 ...

  9. Ubuntu中root用户和user用户的相互切换[转载自93度的饼干]

    Ubuntu中root用户和user用户的相互切换 Ubuntu是最近很流行的一款Linux系统,因为Ubuntu默认是不启动root用户,现在介绍如何进入root的方法. (1)从user用户切换到 ...

  10. httpd: Could not reliably determine the server's fully qualified domain name(转)

    ttpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for Ser ...