版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、2020/7/27,1,Software EngineeringOO Analysis and Design,Yang YI, Ph.D Computer Science Department, SYSU Tel2020/7/27,2,2020/7/27,3,Chapter 8 Usecase Analysis 用例分析,主要内容 用例分析总述 补充用例描述 查找分析类 将用例行为分配给分析类 描述分析类 描述分析机制 合并分析类 案例实践,2020/7/27,4,Objectives: Use-Case Analysis,Explain the purpose of
2、 Use-Case Analysis and where in the lifecycle it is performed Identify the classes which perform a usecase flow of events Distribute the use-case behavior to those classes, identifying responsibilities of the classes Develop Use-Case Realizations that model the collaborations between instances of th
3、e identified classes,2020/7/27,5,Use-Case Analysis Overview,2020/7/27,6,用例分析总览,用例分析,2020/7/27,7,第八章 用例分析,主要内容 用例分析总述 补充用例描述 查找分析类 将用例行为分配给分析类 描述分析类 描述分析机制 合并分析类 案例实践,2020/7/27,8,Use-Case Analysis Steps,Supplement the Use-Case Description For each Use-Case Realization Find Classes from Use-Case Behav
4、ior Distribute Use-Case Behavior to Classes For each resulting analysis class Describe Responsibilities Describe Attributes and Associations Qualify Analysis Mechanisms Unify Analysis Classes Checkpoints,2020/7/27,9,Supplement the Use-Case Description,2020/7/27,10,系统显示 课程列表,系统找到并列出课程目录数据库提供的课程列表,补充用
5、例描述,2020/7/27,11,Use-Case Analysis Steps,Supplement the Use-Case Description For each Use-Case Realization Find Classes from Use-Case Behavior Distribute Use-Case Behavior to Classes For each resulting analysis class Describe Responsibilities Describe Attributes and Associations Qualify Analysis Mec
6、hanisms Unify Analysis Classes Checkpoints,2020/7/27,12,Review: Use-Case Realization,2020/7/27,13,Analysis Classes: A First Step Toward Executables,2020/7/27,14,用例,分析类,源代码,可执行 系统,设计元素,用例分析,分析类:可执行系统的第一步,2020/7/27,15,Find Classes from Use-Case Behavior,The complete behavior of a use case has to be di
7、stributed to analysis classes,2020/7/27,16,从用例行为中查找分析类,实体类,边界类,控制类,系统边界,系统信息,协调用例行为,2020/7/27,17,Boundary Class,Inter mediates between the interface and something outside the system Several Types User interface classes System interface classes Device interface classes One boundary class per actor/us
8、e-case pair,2020/7/27,18,边界类,提供了对参与者或外部系统交互协议的接口 如用户界面,http:/protocols,2020/7/27,19,The Role of a Boundary Class,2020/7/27,20,Example: Finding Boundary Classes,One boundary class per actor/use case pair,2020/7/27,21,如何确定边界类,为用例中涉及到的每对参与者/用例设计一个边界类来封装面向这个参与者的接口,2020/7/27,22,Guidelines: Boundary Class
9、,User Interface Classes Concentrate on what information is presented to the user Do NOT concentrate on the UI details System and Device Interface Classes Concentrate on what protocols must be defined Do NOT concentrate on how the protocols will be implemented,2020/7/27,23,边界类的三种类型 用户接口类 系统接口类 设备接口类
10、设计边界类的指导原则 对于用户接口类,关注于用户界面的交互内容;不是具体窗体构件 对于系统和设备接口类,关注于定义什么通信协议;不要关注协议的实现细节,2020/7/27,24,Entity Class,Key abstractions of the system,2020/7/27,25,The Role of an Entity Class,2020/7/27,26,Example: Finding Entity Classes,Use use-case flow of events as input Key abstractions of the use case Traditional
11、, filtering nouns approach Underline noun clauses in the use-case flow of events Remove redundant candidates Remove vague candidates Remove actors (out of scope) Remove implementation constructs Remove attributes (save for later) Remove operations,2020/7/27,27,Example: Candidate Entity Classes,Regis
12、ter for Courses (Create Schedule),2020/7/27,28,实体类,存储(通常具有持久性)一些现象的信息,并包含与这些信息相关的业务规则 如学生,计划表,课程清单,2020/7/27,29,如何确定实体类,将用例的事件流作为输入 获取用例的关键抽象 过滤名词的方法: 对事件流中的名词加下划线 去除冗余的候选名词 去除含义不明确的候选名词 去除参与者 去除实现结构 去除属性 去除操作,2020/7/27,30,课程注册(建立课程表)中的实体类,学生,课程表,课程提供,2020/7/27,31,Control Class,Use-case behavior coo
13、rdinator More complex use cases generally require one or more control cases,2020/7/27,32,The Role of a Control Class,2020/7/27,33,控制类,封装一个或多个用例所特有的控制行为 控制类有效地分离了边界对象和实体对象,使系统更能承受系统边界的变更,参与者1,参与者2,2020/7/27,34,Example: Finding Control Classes,In general, identify one control class per use case. As an
14、alysis continues, a complex use cases control class may evolve into more than one class,2020/7/27,35,如何确定控制类,通常为每个用例设计一个控制类,封装这个用例的顺序,RegistrationController,2020/7/27,36,Example: Summary: Analysis Classes,2020/7/27,37,课程目录系统,用例模型,设计模型,分析类总览,课程注册表单,课程目录系统,学生,课程表,课程提供,注册控制者,2020/7/27,38,Use-Case Analy
15、sis Steps,Supplement the Use-Case Description For each Use-Case Realization Find Classes from Use-Case Behavior Distribute Use-Case Behavior to Classes For each resulting analysis class Describe Responsibilities Describe Attributes and Associations Qualify Analysis Mechanisms Unify Analysis Classes
16、Checkpoints,2020/7/27,39,第八章 用例分析,主要内容 用例分析总述 补充用例描述 查找分析类 将用例行为分配给分析类 描述分析类 描述分析机制 合并分析类 案例实践,2020/7/27,40,Distribute Use-Case Behavior to Classes,For each use-case flow of events: Identify analysis classes Allocate use-case responsibilities to analysis classes Model analysis class interactions in
17、Interaction diagrams,2020/7/27,41,用例图,用例实现,将用例行为分配给分析类,对于每个用例的事件流: 确定分析类 将用例的职责分配给分析类 在交互图中为分析类建模,2020/7/27,42,Guidelines: Allocating Responsibilities to Classes,Use analysis class stereotypes as a guide Boundary Classes Behavior that involves communication with an actor Entity Classes Behavior that
18、 involves the data encapsulated within the abstraction Control Classes Behavior specific to a use case or part of a very important flow of events,2020/7/27,43,将职责分配给分析类,用分析类的构造型做指导 边界类 行为包括与参与者的联系 实体类 行为包括封装数据 控制类 用例或事件流特有的行为,2020/7/27,44,Guidelines: Allocating Responsibilities to Classes (cont.),Wh
19、o has the data needed to perform the responsibility? If one class has the data, put the responsibility with the data If multiple classes have the data: Put the responsibility with one class and add a relationship to the other Create a new class, put the responsibility in the new class, and add relat
20、ionships to classes needed to perform the responsibility Put the responsibility in the control class, and add relationships to classes needed to perform the responsibility,2020/7/27,45,The Anatomy of Sequence Diagrams,2020/7/27,46,时序图示例,: Student,: RegisterForCoursesForm,: RegistrationController,: S
21、chedule,: Student,: Course Catalog,: CourseCatalogSystem,显示本学期有效的课程提供的清单,新建一个 课程表,1: / create schedule( ),5: / display course offerings( ),2: / get course offerings( ),3: / get course offerings(forSemester),6: / display blank schedule( ),7: / select 4 primary and 2 alternate offerings( ),8: / create
22、 schedule with offerings( ),9: / create with offerings( ),显示空的课程 表让学生选择 课程,10: / add schedule(Schedule),4: / get course offerings( ),在这一点,提交课程表子事件流被执行,2020/7/27,47,Example: Sequence Diagram,2020/7/27,48,The Anatomy of Collaboration Diagrams,2020/7/27,49,Example: Collaboration Diagram,2020/7/27,50,协作
23、图示例,: Student,: RegisterForCoursesForm,: RegistrationController,: Schedule,: Student,: CourseCatalogSystem,5: / display course offerings( ),6: / display blank schedule( ),1: / create schedule( ),7: / select 4 primary and 2 alternate offerings( ),2: / get course offerings( ),8: / create schedule with
24、 offerings( ),9: / create with offerings( ),3: / get course offerings(forSemester),10: / add schedule(Schedule),4: / get course offerings( ),: Course Catalog,2020/7/27,51,Use-Case Analysis Steps,Supplement the Use-Case Description For each Use-Case Realization Find Classes from Use-Case Behavior Dis
25、tribute Use-Case Behavior to Classes For each resulting analysis class Describe Responsibilities Describe Attributes and Associations Qualify Analysis Mechanisms Unify Analysis Classes Checkpoints,2020/7/27,52,第八章 用例分析,主要内容 用例分析总述 补充用例描述 查找分析类 将用例行为分配给分析类 描述分析类 描述分析机制 合并分析类 案例实践,2020/7/27,53,One Int
26、eraction Diagram Is Not Good Enough,2020/7/27,54,Describe Responsibilities,What are responsibilities? How do I find them?,2020/7/27,55,Example: View of Participating Classes (VOPC) Class Diagram,2020/7/27,56,Student,/ get tuition(),/ add schedule(),/ get schedule(),/ delete schedule(),/ has pre-requ
27、isites(),RegistrationController,/ get course offerings(),/ get current schedule(),/ delete current schedule(),/ submit schedule(),/ is registration open?(),/ save schedule(),/ create schedule with offerings(),/ update schedule with new selections(),CourseCatalogSystem,/ get course offerings(),Regist
28、erForCoursesForm,/ display course offerings(),/ display blank schedule(),/ update offering selections(),Schedule,/ commit(),/ select alternate(),/ remove offering(),/ level(),/ cancel(),/ get cost(),/ delete(),/ submit(),/ save(),/ any conflicts(),/ create with offerings(),/ update with new selectio
29、ns(),参与类图示例,2020/7/27,57,/ PerformResponsibility,:Client,:Supplier,交互图,类图,说明职责,什么是职责 怎样找到职责,2020/7/27,58,Maintaining Consistency: What to Look For,In order of criticality Redundant responsibilities across classes Disjoint responsibilities within classes Class with one responsibility Class with no re
30、sponsibilities Better distribution of behavior Class that interacts with many other classes,2020/7/27,59,维持一致性,类中多余的职责 类中分离的职责 只有一个职责的类 没有职责的类 更好的行为分配方式 与许多其他类有交互作用的类,2020/7/27,60,Use-Case Analysis Steps,Supplement the Use-Case Description For each Use-Case Realization Find Classes from Use-Case Beh
31、avior Distribute Use-Case Behavior to Classes For each resulting analysis class Describe Responsibilities Describe Attributes and Associations Qualify Analysis Mechanisms Unify Analysis Classes Checkpoints,2020/7/27,61,Finding Attributes,Properties/characteristics of identified classes Information r
32、etained by identified classes “Nouns” that did not become classes Information whose value is the important thing Information that is uniquely owned” by an object Information that has no behavior,2020/7/27,62,确定属性,类的特征 类要保留的信息 不能成为类的名词 值很重要的信息 某个对象独有的信息 没有行为的信息,2020/7/27,63,Review: What Is an Associa
33、tion?,The semantic relationship between two or more classifiers that specifies connections among their instances A structural relationship, specifying that objects of one thing are connected to objects of another,2020/7/27,64,Finding Relationships,2020/7/27,65,Review: What Is Aggregation?,A special
34、form of association that models whole-part relationship between an aggregate (the whole) and its parts,2020/7/27,66,Association or Aggregation?,2020/7/27,67,PerformResponsibility,链,关联,协作图,类图,0.*,Prime suppliers,0.*,Client,Supplier,PerformResponsibility(),每条链都转换为一个关联,确定关联,2020/7/27,68,不确定时使用关联关系,两个对象
35、有整体-部分的关系 是聚集关系 两个对象被认为是独立的 是关联关系,关联还是聚集,2020/7/27,69,参与类图:关联关系示例,RegisterForCoursesForm,CourseOffering,Schedule,0.*,primaryCourses,0.4,Student,0.*,1,RegistrationController,1,1,0.1,currentSchedule,0.1,2020/7/27,70,Use-Case Analysis Steps,Supplement the Use-Case Description For each Use-Case Realizat
36、ion Find Classes from Use-Case Behavior Distribute Use-Case Behavior to Classes For each resulting analysis class Describe Responsibilities Describe Attributes and Associations Qualify Analysis Mechanisms Unify Analysis Classes Checkpoints,2020/7/27,71,第八章 用例分析,主要内容 用例分析总述 补充用例描述 查找分析类 将用例行为分配给分析类 描
37、述分析类 描述分析机制 合并分析类 案例实践,2020/7/27,72,Review: Why Use Analysis Mechanisms?,Analysis mechanisms are used during analysis to reduce the complexity of analysis, and to improve its consistency by providing designers with a shorthand representation for complex behavior.,2020/7/27,73,Describing Analysis Mec
38、hanisms,Collect all analysis mechanisms in a list Draw a map of the client classes to the analysis mechanisms Identify characteristics of the analysis mechanisms,2020/7/27,74,描述分析机制,收集所有分析机制形成列表 绘制客户类到分析机制的映射图 确定分析机制的特征,2020/7/27,75,Example: Describing Analysis Mechanisms,Analysis class to analysis
39、mechanism map,2020/7/27,76,描述分析机制示例,分析类到分析机制的映射图,2020/7/27,77,Example: Describing Analysis Mechanisms (cont.),Analysis mechanism characteristics Persistency for Schedule class: Granularity: 1 to 10 Kbytes per product Volume: up to 2,000 schedules Access frequency Create: 500 per day Read: 2,000 acce
40、ss per hour Update: 1,000 per day Delete: 50 per day Other characteristics,2020/7/27,78,描述分析机制示例,课程表类使用的持久性: 粒度: 每张课程表占用1到10千字节 容量: 上限为2,000张课程表 访问频率 创建: 每天500次 读取: 每小时2000次 更新: 每天1000次 删除: 每天50次 其它特征,2020/7/27,79,Use-Case Analysis Steps,Supplement the Use-Case Description For each Use-Case Realizat
41、ion Find Classes from Use-Case Behavior Distribute Use-Case Behavior to Classes For each resulting analysis class Describe Responsibilities Describe Attributes and Associations Qualify Analysis Mechanisms Unify Analysis Classes Checkpoints,2020/7/27,80,第八章 用例分析,主要内容 用例分析总述 补充用例描述 查找分析类 将用例行为分配给分析类 描
42、述分析类 描述分析机制 合并分析类 案例实践,2020/7/27,81,Unify Analysis Classes,2020/7/27,82,合并分析类,Register for Courses,Close Registration,Student,Course Offering,Course Offering,Student,CloseRegistration Controller,Registration Controller,CloseRegistration Form,Course Catalog System,Schedule,Course Catalog System,Cours
43、e Offering,Schedule,Registration Controller,Student,CloseRegistration Controller,Schedule,Course Catalog System,Billing System,RegisterFor CoursesForm,RegisterFor CoursesForm,Billing System,CloseRegistration Form,2020/7/27,83,Evaluate Your Results,2020/7/27,84,评估用例分析结果,2020/7/27,85,Use-Case Analysis
44、 Steps,Supplement the Use-Case Description For each Use-Case Realization Find Classes from Use-Case Behavior Distribute Use-Case Behavior to Classes For each resulting analysis class Describe Responsibilities Describe Attributes and Associations Qualify Analysis Mechanisms Unify Analysis Classes Checkpoints,2020/7/27,86,第八章 用例分析,主要内容 用例分析总述 补充用例描述 查找分析类 将用例行为分配给分析类 描述分析类 描述分析机制 合并分析类 案例实践,2020/7/27,87,Checkpoints: Analysis Classes,Are the classes reasonable? Does the name of each class clearly reflect the role i
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2206北京大学未来技术学院招聘劳动合同制人员1人备考题库及1套完整答案详解
- 关键部位、岗位值班制度
- 2026重庆永川区中山路街道办事处中山路社区招聘全日制公益性岗位人员1人备考题库及完整答案详解一套
- 2026湖南娄底市人力资源和社会保障局娄底市就业见习岗位备考题库(典优)附答案详解
- 2026贵州贵阳贵安招聘中小学(幼儿园)教师819人备考题库附完整答案详解【历年真题】
- 公路隧道仰拱施工技术方案
- 2026贵州红星电子材料有限公司招聘6人备考题库含完整答案详解【必刷】
- 2026年春季贵州电网有限责任公司校园招聘备考题库附答案详解【能力提升】
- 公园地面铺装工程专项施工方案
- 2026中冶京诚工程技术有限公司春季校园招聘备考题库往年题考附答案详解
- Picco在休克患者治疗中的应用
- 分级诊疗双向转诊共享决策机制
- 2026年及未来5年中国连续排放监测系统(CEMS)行业市场发展现状及投资方向研究报告
- 三年级两位数乘加乘减计算练习题(每日一练共18份)
- (2026春新版)人教版二年级数学下册全册教学设计
- 炼钢厂各岗位薪酬制度
- 产前诊断中心建设方案
- 乡镇卫生院医保基金使用管理制度
- 横纹肌肉瘤免疫治疗耐药性的逆转策略
- 2026年锡林郭勒职业学院单招综合素质考试题库附答案解析
- CNC撞机培训教学课件
评论
0/150
提交评论