1 / 11

设计类图

设计类图. 小组成员: 江 帆 康乐 梁忠 彪 王金鑫. 类图有多重要?.

Download Presentation

设计类图

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 设计类图 小组成员: 江帆 康乐 梁忠彪 王金鑫

  2. 类图有多重要? • Martin Fowler在其著作《UML Distilled: A Brief Guide to the Standard Object Modeling Language, Third Edition》(《UML精粹:标准对象建模语言简明指南(第3版)》)中有这么一段:“If someone were to come up to you in a dark alley and say, ‘Psst, wanna see a UML diagram?’ that diagram would probably be a class diagram. The majority of UML diagrams I see are class diagrams.”(“如果有人在黑暗的小巷中向你走来并对你说:‘嘿,想不想看一张UML图?’那么这张图很有可能就是一张类图,我所见过的大部分的UML图都是类图”)(高冷。。。)

  3. 类的UML图示 •  在UML类图中,类一般由三部分组成:类名、类的属性、类的操作 • 在UML中,类使用包含类名、属性和操作且带有分隔线的长方形来表示 • 例:

  4. 类图的几种关系 • 1. 泛化(Generalization) • 关键词:继承 • 【箭头指向】:带三角箭头的实线,箭头指向父类 • 2. 实现(Realization) • 关键词:类与接口 • 【箭头指向】:带三角箭头的虚线,箭头指向接口 • 3. 关联(Association) • 关键词:拥有 • 【箭头及指向】:带普通箭头的实心线,指向被拥有者

  5. 类图的几种关系 • 4. 聚合(Aggregation) 关键词:整体与部分可独立 【箭头及指向】:带空心菱形的实线,菱形指向整体 • 5.组合(Composition) 关键词:整体与部分2 不独立 【箭头及指向】:带实心菱形的实线,菱形指向整体 • 6. 依赖(Dependency) 关键词:使用 【箭头及指向】:带箭头的虚线,指向被使用者

  6. 怎么画类图 • 先绘制顺序图 • 根据顺序图绘制类图

  7. 7. 设计类图(Design Class Diagram) 实验目的: 1. 掌握设计类图的涵义和内容2. 掌握设计类图的绘制方法3. 掌握设计类图与顺序图之间的关系实验内容: 1. 以练习五,任务2“订单生成”顺序图为基础,建立以订单、购物车为核心对象的设计类图。要求,对象,属性,方法(职责),对象之间依赖关系实验指导: 1. UML 2 Class Diagrams [http://www.agilemodeling.com/artifacts/classDiagram.htm]2. 软件开发设计模型 - 类图 [http://msdn.microsoft.com/zh-cn/library/dd409436.aspx]

  8. 设计类图

  9. THX!

More Related