版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、面向对象的分析与设计简介,OOA for example, a cashier. A scenario is a specific sequence of actions and interactions between actors and the system; it is also called a use case instance. It is one particular story of using a system, or one path through the use case; for example, the scenario of successfully purch
2、asing items with cash, or the scenario of failing to purchase items because of a credit payment denial. a use case is a collection of related success and failure scenarios that describe an actor using a system to support a goal. For example, here is a casual format use case with alternate scenarios:
3、,2020/9/14,Institute of Computer Software Nanjing University,29,Process Sale,2020/9/14,Institute of Computer Software Nanjing University,30,2020/9/14,Institute of Computer Software Nanjing University,31,Actor有Goal,Ivar Jacobson: A set of use-case instances, where each instance is a sequence of actio
4、ns a system performs that yields an observable result of value to a particular actor. 软件工程师容易犯的错误:自认为所做的是客户/用户需要的。 不能代替客户/用户假想其价值所在。,2020/9/14,Institute of Computer Software Nanjing University,32,创建USE CASE的一些原则,用例可以是一个场景,包括动作和交互。 用例可以是一组场景,描述不同场景下的行为。这种书写格式可以在任何时候描述有变体的行为,例如黑盒需求,业务流程,系统设计说明。 用例里不要有
5、系统设计,用例里不要有界面设计,用例里不要有特性列表,用例里不要有测试。 用例应该描述行为需求。 用例的主场景不要超过九步。可以在适当的层次上得到子目标和移除设计说明。 用例的最大价值不在于主场景,而是在于备选行为。主场景可能只占用例长度的四分之一到十分之一。,2020/9/14,Institute of Computer Software Nanjing University,33,用例的识别,界定系统边界 基于参与者 先识别参与者 对每个参与者,找出其所发起和参与的过程 基于事件 识别系统必须响应的外部事件 把事件与参与者和用例联系起来,2020/9/14,Institute of Com
6、puter Software Nanjing University,34,边界,Actors,Goals,2020/9/14,Institute of Computer Software Nanjing University,35,识别Actors及其Goals,除了明显的Actors之外,还要问问诸如以下这些问题: Who starts and stops the system? Who does system administration? Who does user and security management? Is time an actor because the system
7、does something in response to a time event? Is there a monitoring process that restarts the system if it fails? Who evaluates system activity or performance? How are software updates handled? Push or pull update? Who evaluates logs? Are they remotely retrieved? In addition to human primary actors, a
8、re there any external software or robotic systems that call upon services of the system? Who gets notified when there are errors or failures?,36,Use cases favor a functional approach!,“Also, name use cases starting with a verb.” NOT very useful in finding classes. But, useful in understanding requir
9、ements, validating the resulted model and implementation. 此外还要对照FURPS+检查其他需求,2020/9/14,Institute of Computer Software Nanjing University,37,Find the classes,“The nouns and the verbs” 启发:类与方法; 但是 “The elevator will close its door before it moves to another floor.” 有的名词不是类; 有的类不表现为名词; 基本原则:ADT,2020/9/
10、14,Institute of Computer Software Nanjing University,38,Find the classes,没有机械的办法。 基于经验的启发性、指导性的原则: 哪些东西是可能的类; 哪些形式的类不理想,可考虑从模型中去除;,2020/9/14,Institute of Computer Software Nanjing University,39,The ideal class,明确的抽象 类名是名词或形容词,刻画该抽象 形容词 常用于 表达接口 代表一系列运行时刻的对象。 (允许特意的singleton) 有修改操作(或作用式操作) 形式或非形式地刻画性
11、质:不变式 前后置断言,2020/9/14,Institute of Computer Software Nanjing University,40,三种 类,分析类 直接对应于问题域 设计类 为得到优雅的、可扩展的结构而引入 实现类 满足软件系统实现算法所需。如LinkedList; Array等,2020/9/14,Institute of Computer Software Nanjing University,41,分析类,Analysis classes represent an early conceptual model for things in the system whic
12、h have responsibilities and behavior. Analysis classes are used to capture a first-draft, rough-cut of the object model of the system. Analysis classes handle primarily functional requirements. They model objects from the problem domain.,2020/9/14,Institute of Computer Software Nanjing University,42
13、,分析类,There are three aspects of the system that are likely to change: the boundary between the system and its actors (boundary) the information the system uses (entity) the control logic of the system (control),2020/9/14,Institute of Computer Software Nanjing University,43,Heuristics for finding cla
14、sses,寻找分析类 Operational Model of some aspect of the external world. Simulation But external classes can be quite abstract 不一定是客观实体,也可能是抽象概念,2020/9/14,Institute of Computer Software Nanjing University,44,Heuristics for finding classes,寻找实现类 实现难 多复用 数据结构与算法知识 延迟实现类 如“Queue” 类层次 组织 多种不同实现,2020/9/14,Inst
15、itute of Computer Software Nanjing University,45,Heuristics for finding classes,寻找设计类 创造性工作 设计模式的用武之地 其他途径 旧系统 Adaptation through inheritance,2020/9/14,Institute of Computer Software Nanjing University,46,2020/9/14,Institute of Computer Software Nanjing University,47,2020/9/14,Institute of Computer
16、Software Nanjing University,48,2020/9/14,Institute of Computer Software Nanjing University,49,2020/9/14,Institute of Computer Software Nanjing University,50,Domain Model 领域模型,A domain model is a representation of real-world conceptual classes not a representation of software components. not a set of
17、 diagrams describing software classes, not software objects with responsibilities. A domain model is a visual representation of conceptual classes or real-world objects in a domain of interest MO95, Fowler96 They have also been called conceptual models, domain object models, and analysis object mode
18、ls The UP defines a Domain Model as one of the artifacts that may be created in the Business Modeling discipline.,2020/9/14,Institute of Computer Software Nanjing University,51,Domain Model,Using UML notation, a domain model is illustrated with a set of class diagrams in which no operations are defi
19、ned. It may show: domain objects or conceptual classes associations between conceptual classes attributes of conceptual classes,2020/9/14,Institute of Computer Software Nanjing University,52, Informally, a conceptual class is an idea, thing, or object. More formally, a conceptual class may be consid
20、ered in terms of its symbol, intension, and extensionMO95.,Domain Model,2020/9/14,Institute of Computer Software Nanjing University,53,Domain Model,Software problems can be complex; Decomposition (divide-and-conquer) is a common strategy to deal with this complexity by division of the problem space
21、into comprehensible units. In structured analysis, the dimension of decomposition is by processes or functions. However, in object-oriented analysis, the dimension of decomposition is fundamentally by things or entities in the domain. A central distinction between object-oriented and structured anal
22、ysis is: division by conceptual classes (objects) rather than division by functions. A primary analysis task is to identify different concepts in the problem domain and document the results in a domain model,2020/9/14,Institute of Computer Software Nanjing University,54,System Sequence Diagrams,识别系统
23、事件 定义系统操作 给出这些操作的Contracts,2020/9/14,Institute of Computer Software Nanjing University,55,2020/9/14,Institute of Computer Software Nanjing University,57,接下来,建立系统类模型 类图 在类之间分配职责,2020/9/14,Institute of Computer Software Nanjing University,58,摘要,引言 如何发现“类” 如何设计“类” 小结,2020/9/14,Institute of Computer Sof
24、tware Nanjing University,59,Class Design,OO设计是一个迭代的过程! 把分析类直接带入设计阶段 如果在设计阶段合并了分析模型,那么在演化的时候,保持分析和设计模型的一致性会更容易 类设计:增加细节和执行精细决策,2020/9/14,Institute of Computer Software Nanjing University,60,Class Design,填补从高层需求到低层服务之间的空白 用操作实现用例 阐述每个操作的算法 选择算法;数据结构;设计内部类和操作 向下递归到支持更高层操作的设计操作 功能分层;机制分层 把模型重构成更简洁的设计,2020/9/14,Institute of Computer Software Nanjing University,61,Class Design,优化数据的访问路径 效率问题 具体化必须操作的行为 Command, Strategy模式 调整类的结构以增加继承 重新调整类和操作;提取公共行为;使用委托来共享行
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 苏教版三年级数学上册教案【表格式】
- 精神科护理学承德躯体形式障碍
- 推进绿色综合医院建设的工作计划
- 主管年度工作计划的核心工作项
- 战略投资风险评估计划
- 股票交易撮合协议三篇
- 生产操作标准化与规范化计划
- 提升工作效率的个人目标设定计划
- 2024行政前台接待礼仪培训
- 河北省部分学校2024-2025学年高三上学期11月阶段调研检测二 英语 含解析
- 煤油渗漏试验要求
- 三级医师查房制度(1)
- 礼仪与教化(PPT页)
- 冀教版三年级上册英语期中试卷.
- 人行道铺砖施工方案
- 利用java实现TFTP协议
- 药剂学药物动力学考点归纳
- 中心城排水管网改造三期工程有限空间作业专项方案
- SDR特别提款权PPT课件
- SH/T3903-石油化工建设工程项目监理规范(承包单位用表)
- 建筑垃圾综合处理厂项目可行性研究报告(完整版)
评论
0/150
提交评论