本科课程:UML面向对象建模与设计(一)

1、what is object-orientation?

The term object-oriented (OO) means that we organize software as a collection of discrete objects that incorporate both data structure and behavior.

object 对象
Something perceptible by one or more of the senses, especially by vision or touch.combines both data structure and behavior.

Object-orientation include four aspects:

  • identity 标识符
  • classification 分类
  • inheritance 继承
  • polymorphism 多态
identity 标识

the data is quantized into discrete, distinguishable entities called boject.标识是数据被量化成对象的离散的可辨识的实体

Two objects are distinct even if all their attribute values are
identical. Such object references are uniform and independent of the
contents of the objects

classification 分类

objects with the same data structure or attributes(属性) and behavior or operations(操作) are grouped into a class.

Classification means that objects with the same data structure (attributes) and behavior (operations) are grouped into a class.

inheritance 继承

inheritance is the sharing of attributes and operations among classes based ono a hierarchical(分层) relationship.
A superclass(父类) has general information that subclasses(子类) refine and elaborate.

Inheritance is the sharing of attributes and operations among classes based on a hierarchical relationship.

polymorphism 多态

the same operation may behave differently for different classes.一个相同的操作会有不同的行为

Polymorphism means that the same operation may behave differently for different classes.

operation 操作
An operation is a procedure or transformation that an object performs or is subject to.操作是对象执行或被执行的一个过程或转换

class 类
class is an abstraction(抽象) that describes properties(属性) and ignores the rest

instance 实例
each object is said to be an instance of its class.

message 消息
The communication structure between objects is message.

method 方法
The behavior’s implement process is method.

2、Elements of object-orientation

abstraction 抽象

Abstraction lets you focus on essential aspects of an application while ignoring details.

抽象是指强调事物的本质、内在的属性,而忽略一些无关紧要的属性。在决定如何用代码实现一个对象之前,先确定对象的本质意义和行为。使用抽象可以尽可能避免过早考虑一些细节,但是抽象是有限度的,要合理抽象。

Encapsulation 封装性

Encapsulation (also information hading) separates the external aspects of an object, that are accessible to other objects, from the internal implementation details, that are hidden from other objects.

封装性是指将对象的外部因素(即可以被其他对象访问的部分)与内部实现细节(即其他对象不可见的部分)分离开来。这种内部实现与外部可访问性的分离是保证软件具有良好的模块性的基础。

Encapsulation prevents portions of a program from becoming so interdependent that a small change has massive ripple effects.

封装防止了程序相互依赖性而带来的变动影响。

Combing Data and Behavior 数据和行为的结合

The caller of an operation need not consider how many implementations exist. Operator polymorphism shifts the burden of deciding what implementation to use from the calling code to the class hierarchy.

sharing 共享性

OO techniques promote sharing at different levels.
Inheritance of both data structure and behavior let subclass share
common code.

  • Sharing in same class
    同一个类中的对象有着相同的数据结构和相同的行为特征。
  • Sharing in same application
    在同一应用的类层次结构中,存在继承关系的各相似子类中,存在数据结构和行为的继承,使各相似子类共享相同的结构和行为。
  • Sharing in different application
    通过类库这种机制和结构来实现不同应用中的信息共享。
Emphasis on the Essence of an Object 强调对象结构而不是程序结构

OO technology stresses what an object is, rather than how it is used. The uses of an object depend on the details of the application and often change during development.

面向对象技术强调明确对象是什么,而不强调对象是如何被使用的。对象的使用依赖于应用时的细节,并且它的使用在整个开发过程中可能不断变化。

Synergy 协同

Identity, classification, polymorphism, and inheritance characterize OO languages. Each of these concepts can be used in isolation, but together they complement each other synergistically.

对象唯一性,分类性,多态性和继承性都是OO语言的特性。这些概念中的每一个都可以分开使用,但是结合在一起,它们就会相互促进,互相补充。

3、three model of object-orientation

class model 类模型

类模型表示了静态的、结构化的系统数据性质,描述了系统的静态结构,是从客观世界实体的对象关系角度来描述。表现了对象间的相互关系。该模型重点关心系统中对象的结构、属性和操作。类模型使用了类图(class diagram)工具来刻画,是其他两个模型的框架。

state model 状态模型

状态模型是与时间和变化有关的系统性质。该模型描述了系统的控制结构,表示了瞬时的、行为化的系统控制性质;它关心的是系统的控制,操作的执行顺序;它从对象的时间和状态的角度出发,表现了对象的相互行为。状态模型使用状态图(state diagram)来确定并实现这种控制。

interaction model 交互模型

交互模型描述了系统中的对象如何协作以完成所有的任务。也就是说,交互模型表明一个计算如何从输入值得到输出值。交互模型使用用例图(user case),序列图(sequence diagram),活动图(activity diagram)等。

交互模型指出了发生了什么,状态模型确定了什么时候发生,类模型确定发生的客体。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
计算机类“卓越工程师”创新系列教材 《UML面向对象需求分析与建模教程--基于uml2.5标准》 邹盛荣主编 书号:978-7-03-044467-7 科学出版社 2015 本书主要介绍基于UML2.5标准系统建模的基本理论、软件分析与设计方法,书中加强了软件案例的UML示例说明,以提高学生的软件分析与设计水平,进一步托展学生分析问题、解决问题的能力,达到培养“厚基础、宽口径、会应用、能发展”的卓越人才的宗旨。   全书共13章,内容包括绪论、面向对象方法、UML建模语言、RUP 统一过程、工具、UML更多细节、系统的需求获取、分析、设计、实现和测试、UML高级课题、案例介绍等。每章均有相关工程实践中的案例说明及实践应用的创意思考和提示,书的最后一章重点描述一个完整的UML建模课程设计案例。   本书深入浅出,通俗易懂,具有很好的可读性,实用性强。   本书内容全面,配有精美ppt, 可作为大学本科软件工程类、计算机等专业的教材或参考书,可有针对性地运用于卓越工程师培养计划,还可供各类研究生及科研人员参考使用,还可供从事软件开发应用的工程技术人员参考。 特色: 案例引导,实用性强,不讲太多的UML理论; 按软件系统的大小分类讲述建模步骤,一步步引导培养学生动手实践的能力; 结合RUP统一过程,按照软件工程的过程需要讲述,不是唯理论而上; 提供配套ppt教学; 可供本科生、工程硕士和学术类研究生参考; 书上大中型案例可供本科毕业设计参考 。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值