uml02.pptVIP

  • 6
  • 0
  • 约1.19万字
  • 约 10页
  • 2017-10-03 发布于河南
  • 举报
uml02

UML建模语言及工具 第 2 章 对象技术与可视化建模基础 An Overview of Object Technology and Visual Modeling Review: An Approach to the Object-Oriented 上升到面向对象 面向对象技术概述 定义、利益、研究内容 面向对象技术发展 历史(里程碑)、现状、未来 面向对象与结构化 扬弃而非否定 上升到面向对象 利用面向对象的观点认识客观问题 学习线路图 Agenda 1 对象与类(Object and Class) 面向对象的基本原则 泛化和多态 可视化建模的基本原则 UML基础 过程与可视化建模 Object Informally, an object represents an entity, either physical, conceptual, or software Physical entity Conceptual entity Software entity Object-Formal Definition An object is an entity with a well-defined boundary and identity that encapsulates(封装) state and behavior. State is represented by attributes and relationships. Behavior is represented by operations, methods, and state machines. 对象的标识 每一个对象都有一个唯一的标识, 即使其状态有可能与其它对象一样 对象的状态 一个对象的状态是它反映于现实世界的一系列属性: 参数(也就是,与对象有关系的数据) 它与其它对象的关系 对象的行为 定义当其它对象发出请求时,该对象如何反应 由为对象定义的一系列操作决定 Sample-An Object Representing Objects in the UML An object is represented as a rectangle with an underlined name. Class A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics. An object is an instance of a class. A class is an abstraction in that it Emphasizes relevant characteristics. Suppresses other characteristics. Sample-A Class Representing Classes in the UML A class is represented using a rectangle with compartments. 类 对象的类 属性 属性是类的特征或特性 属性的值是某一特定对象的属性值 在类中属性名必须是唯一的 每个类的实例对应类的所有属性都必须有值 属性取决于视角 操作 对象的行为是由为此对象定义的一系列操作决定的 操作访问或修改对象的属性值 一个类可能同时存在多个实例,也可能在某一时刻没有实例 一个类的所有实例都可以使用在这个类中定义的操作 类和对象 类是生成对象的模板 类是生成对象的模板 类的定义中包含有产生和删除对象的操作 一个类定义了使用哪种数据表示法来描述属性 每一个实例都采用有属性值的数据表示法 一个类通过一系列操作来定义行为 这种操作能在每个实例中激活 类和对象的关系 每一个对象都是某一个类的实例 每一个类在某一时刻都有零个或更多的实例 类是静态的;它们的存在、语义和关系在执行前就已经定义好了 对象是动态的;它们在程序执行时可以被创建和删除 Sample-Object and Class Agenda-2 对象与类 面向对象的四个基本原则(Four Principles of OO) 泛化和多态 可视化建模的基本原则 UML基础 过程与可视化建模 Basic Principles of Object Orientation Example: Abstraction 封装性-Encapsulation Hides implementation from clients. Clients depend on interface. 封装性 封装(encapsulation)是软件模块化思想的体现,也是面向对象的根本之一 封

文档评论(0)

1亿VIP精品文档

相关文档