面向对象的分析与设计方案简介ppt课件_第1页
面向对象的分析与设计方案简介ppt课件_第2页
面向对象的分析与设计方案简介ppt课件_第3页
面向对象的分析与设计方案简介ppt课件_第4页
面向对象的分析与设计方案简介ppt课件_第5页
已阅读5页,还剩63页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、面向对象的分析与设计简介OOA & OOD: An introduction2022-5-1Institute of Computer SoftwareNanjing University1摘要引言如何发现“类如何设计“类小结2022-5-1Institute of Computer SoftwareNanjing University2摘要引言引言如何发现如何发现“类类如何设计如何设计“类类小结小结2022-5-1Institute of Computer SoftwareNanjing University3面向对象软件工程2022-5-1Institute of Computer

2、 SoftwareNanjing University4问题域问题域需求分析需求分析总体设计总体设计详细设计详细设计计算机计算机OOTOOPOODOOA问题域问题域编程编程测试测试计算机计算机自然言语自然言语自然言语自然言语分析与设计的鸿沟分析与设计的鸿沟编程言语编程言语自然言语自然言语面向对象的编程言语面向对象的编程言语传统的软件工程方法传统的软件工程方法面向对象的软件工程方法面向对象的软件工程方法面向对象软件工程面向对象方法真正意义深远的目的是它适宜于处理分析与设计期间的复杂性并实现分析与设计的复用。面向对象的开发不仅仅是编程,必需在整个软件生命周期采用一种全新的方法:在软件开发过程一切阶

3、段都运用面向对象的方法,将OOA,OOD,OOP,OOT有机地集成在一同,这样有利于系统的稳定性。2022-5-1Institute of Computer SoftwareNanjing University5面向对象软件工程喷泉模型以用户需求为动力,以对象为驱动各阶段是相互迭代和无间隙的运用一样的描画方法和模型,使得软件生存期各阶段所运用的方法、技术具有高度的延续性。2022-5-1Institute of Computer SoftwareNanjing University62022-5-1Institute of Computer SoftwareNanjing University

4、7面向对象方法BoochCoad/YourdonOMT:对象模型,功能模型,动态模型JacobsonUMLl三种根本活动三种根本活动l识别类和对象识别类和对象l描画对象和类之间描画对象和类之间的关系的关系l经过描画每个类的经过描画每个类的功能定义对象的行功能定义对象的行为为面向对象方法Rational Unified Process (RUP) Rational一致开发过程迭代式的增量开发用例驱动以软件体系构造为中心2022-5-1Institute of Computer SoftwareNanjing University8面向对象的分析与设计OO方法强调开发过程的延续性构造一系列不断精化

5、的面向对象的模型实践上目前大多倾向于采用迭代式开发类成为分析、设计和实现的根本单元中心问题:How to find the classes 不同层面的类?How to design the classes?2022-5-1Institute of Computer SoftwareNanjing University9引荐CraigLarman: Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development 2022-5-1Institute

6、 of Computer SoftwareNanjing University10面向对象分析OOA是软件开发过程中的问题定义阶段领域分析Domain Analysis:抽取和整理用户需求并建立问题域准确模型的过程。以公共对象、类和框架等方式在特定运用领域中标识、分析和规约公共的可复用的软件成分的才干。笼统出目的系统的本质属性,建立问题领域模型。运用分析Application Analysis:将领域分析建立起来的问题领域模型,用某种基于计算机系统的言语来表示。呼应时间需求、用户界面需求和数据平安等特殊的需求也都在这一层分解抽出。2022-5-1Institute of Computer So

7、ftwareNanjing University11面向对象分析领域分析2022-5-1Institute of Computer SoftwareNanjing University12领域领域知识知识源源领域领域分析分析模型模型领域领域分析分析技术文件技术文件专家建议专家建议已有运用已有运用客户调查客户调查目前目前/未来的需未来的需求求类的分类类的分类复用规范复用规范功能模型功能模型领域言语领域言语2022-5-1Institute of Computer SoftwareNanjing University13面向对象分析详细步骤2022-5-1Institute of Computer

8、 SoftwareNanjing University14获取用户根本需求获取用户根本需求标识类和对象标识类和对象定义类的构造和层定义类的构造和层次次表示类对象间表示类对象间的关系的关系为对象行为建模为对象行为建模常用用例来搜集和描画用常用用例来搜集和描画用户的需求户的需求标识类及类的属性和效力标识类及类的属性和效力描画系统的静态构造描画系统的静态构造描画系统的动态行为描画系统的动态行为2022/5/1Institute of Computer SoftwareNanjing University15需求分析Waterfall式开发其需求分析一开场其实是过早地确定的式开发其需求分析一开场其实是

9、过早地确定的features 在最终产品中真正采用情况的比例在最终产品中真正采用情况的比例Requirement checklistFURPS+Functionalfeatures, capabilities, securityUsabilityhuman factors, help, documentationReliabilityfrequency of failure, recoverability, predictabilityPerformanceresponse times, throughput, accuracy, availability, resource usage.Su

10、pportability adaptability, maintainability, internationalization, configurability.“+Implementation Interface Operations Packaging Legal 2022-5-1Institute of Computer SoftwareNanjing University16ClassificationFunctional requirements: behavior, features, capabilities,securityUsability requirements: hu

11、man factors, help, documentation“The font on the display should be readable from 5 feet2022-5-1Institute of Computer SoftwareNanjing University17ClassificationReliability requirements: frequency of failure, recoverabilityPerformance requirements: response times, throughput, accuracy, availability, r

12、esource usage, etc.2022-5-1Institute of Computer SoftwareNanjing University18ClassificationSupportability requirements: adaptability, internationalization, maintainability“The system should allow frequent and easy changes in the network configurationThe + in the FURPS+: Implementation requirements:

13、“Must use Linux and Java2022-5-1Institute of Computer SoftwareNanjing University19面向对象分析OOA模型2022-5-1Institute of Computer SoftwareNanjing University20根本模型类图根本模型类图对象层对象层特征层特征层关系层关系层交交互互图图主主题题图图详细阐明详细阐明面向对象设计OOD是面向对象方法在软件设计阶段运用与扩展的结果,通常分为两个阶段高层设计:建立运用的体系构造低层设计:集中于类的详细设计OOD的准那么笼统,信息隐藏,模块化,弱耦合,强内聚,可重用2

14、022-5-1Institute of Computer SoftwareNanjing University21面向对象设计OOD详细内容按实现条件对OOA模型进展调整,并补充几个新的组成部分:设计问题域组元设计人机交互组元设计义务管理组元设计数据管理组元2022-5-1Institute of Computer SoftwareNanjing University22摘要引言如何发现“类如何设计“类小结2022-5-1Institute of Computer SoftwareNanjing University23回想:三个世界Three worldsVisual modeling202

15、2-5-1Institute of Computer SoftwareNanjing University242022-5-1Institute of Computer SoftwareNanjing University25现实世界现实世界问题世界问题世界软件世界软件世界Reality笼统笼统问题:How to find the classes?Use case基于需求文档Use-case model: writing requirements in context2022-5-1Institute of Computer SoftwareNanjing University26用例Use

16、Cases用例是一个表达性文档,用来描画参与者运用系统完成某个过程时的事件发生顺序。用例乃是对过程的描画。过程描画事件、动作和事务处置自始至终的发生顺序。Use cases are text documents, not diagrams, and use-case modeling is primarily an act of writing text, not drawing diagrams.2022-5-1Institute of Computer SoftwareNanjing University27Use Case例子:Process Sale: A customer arriv

17、es at a checkout with items to purchase. The cashier uses the POS system to record each purchased item. The system presents a running total and line-item details. The customer enters payment information, which the system validates and records. The system updates inventory. The customer receives a re

18、ceipt from the system and then leaves with the items.2022-5-1Institute of Computer SoftwareNanjing University28Actor, Scenario, Use Case简单地说,an actor is something with behavior, such as a person (identified by role), computer system, or organization; for example, a cashier.A scenario is a specific s

19、equence 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 purchasing items with cash, or the scenario of failing to purchase items

20、 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:2022-5-1Institute of Computer SoftwareNanjing University29Process Sa

21、le2022-5-1Institute of Computer SoftwareNanjing University302022-5-1Institute of Computer SoftwareNanjing University31Actor有GoalIvar Jacobson: A set of use-case instances, where each instance is a sequence of actions a system performs that yields an observable result of value to a particular actor.软

22、件工程师容易犯的错误:自以为所做的是客户/用户需求的。不能替代客户/用户假想其价值所在。2022-5-1Institute of Computer SoftwareNanjing University32创建USE CASE的一些原那么用例可以是一个场景,包括动作和交互。用例可以是一组场景,描画不同场景下的行为。这种书写格式可以在任何时候描画有变体的行为,例如黑盒需求,业务流程,系统设计阐明。 用例里不要有系统设计,用例里不要有界面设计,用例里不要有特性列表,用例里不要有测试。用例应该描画行为需求。用例的主场景不要超越九步。可以在适当的层次上得到子目的和移除设计阐明。用例的最大价值不在于主场景

23、,而是在于备选行为。主场景能够只占用例长度的四分之一到非常之一。2022-5-1Institute of Computer SoftwareNanjing University33用例的识别界定系统边境基于参与者先识别参与者对每个参与者,找出其所发起和参与的过程基于事件识别系统必需呼应的外部事件把事件与参与者和用例联络起来2022-5-1Institute of Computer SoftwareNanjing University34边境,Actors,Goals2022-5-1Institute of Computer SoftwareNanjing University35识别Actor

24、s及其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 does something in response to a time event?Is there a monitoring process that restarts the system if it fails?Who evaluates syst

25、em 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, are there any external software or robotic systems that call upon services of the system?Who gets notified when there are errors or fa

26、ilures?36Use cases favor a functional approach!“Also, name use cases starting with a verb.NOT very useful in finding classes.But, useful in understanding requirements, validating the resulted model and implementation.此外还要对照FURPS+检查其他需求2022-5-1Institute of Computer SoftwareNanjing University37Find th

27、e classes“The nouns and the verbs启发:类与方法;但是“The elevator will close its door before it moves to another floor.有的名词不是类;有的类不表现为名词;根本原那么:ADT2022-5-1Institute of Computer SoftwareNanjing University38Find the classes没有机械的方法。基于阅历的启发性、指点性的原那么:哪些东西是能够的类;哪些方式的类不理想,可思索从模型中去除;2022-5-1Institute of Computer Soft

28、wareNanjing University39The ideal class明确的笼统类名是名词或描画词,描写该笼统描画词 常用于 表达接口代表一系列运转时辰的对象。允许特意的singleton有修正操作或作用式操作方式或非方式地描写性质:不变式 前后置断言2022-5-1Institute of Computer SoftwareNanjing University40三种 类分析类直接对应于问题域设计类为得到优雅的、可扩展的构造而引入实现类满足软件系统实现算法所需。如LinkedList; Array等2022-5-1Institute of Computer SoftwareNanji

29、ng University41分析类Analysis classes represent an early conceptual model for things in the system which 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 mod

30、el objects from the problem domain. 2022-5-1Institute of Computer SoftwareNanjing University42分析类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)

31、2022-5-1Institute of Computer SoftwareNanjing University43behaviourinformationboundaryHeuristics for finding classes寻觅分析类Operational Model of some aspect of the external world.SimulationBut external classes can be quite abstract 不一定是客观实体,也能够是笼统概念2022-5-1Institute of Computer SoftwareNanjing Universi

32、ty44Heuristics for finding classes寻觅实现类实现难多复用数据构造与算法知识延迟实现类如“Queue 类层次 组织 多种不同实现2022-5-1Institute of Computer SoftwareNanjing University45Heuristics for finding classes寻觅设计类发明性任务设计方式的用武之地其他途径旧系统Adaptation through inheritance 2022-5-1Institute of Computer SoftwareNanjing University462022-5-1Institute

33、 of Computer SoftwareNanjing University472022-5-1Institute of Computer SoftwareNanjing University482022-5-1Institute of Computer SoftwareNanjing University492022-5-1Institute of Computer SoftwareNanjing University50Domain Model 领域模型A domain model is a representation of real-world conceptual classes

34、not a representation of software components. not a set of 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, Fowler96They have also been called conceptual

35、 models, domain object models, and analysis object modelsThe UP defines a Domain Model as one of the artifacts that may be created in the Business Modeling discipline.2022-5-1Institute of Computer SoftwareNanjing University51Domain ModelUsing UML notation, a domain model is illustrated with a set of

36、 class diagrams in which no operations are defined. It may show:domain objects or conceptual classesassociations between conceptual classesattributes of conceptual classes2022-5-1Institute of Computer SoftwareNanjing University52 Informally, a conceptual class is an idea, thing, or object. More form

37、ally, a conceptual class may be considered in terms of its symbol, intension, and extensionMO95.Domain Model2022-5-1Institute of Computer SoftwareNanjing University53Domain ModelSoftware problems can be complex;Decomposition (divide-and-conquer) is a common strategy to deal with this complexity by d

38、ivision of the problem space 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-

39、oriented and structured analysis 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 model2022-5-1Institute of Computer SoftwareNanjing University54System S

40、equence Diagrams识别系统事件定义系统操作给出这些操作的Contracts2022-5-1Institute of Computer SoftwareNanjing University552022-5-1Institute of Computer SoftwareNanjing University57Contract CO2: enterItemOperation:enterItem(itemID: ItemID, quantity: integer)Cross References: Use Cases: Process SalePreconditions:There is a sale underway.Postconditions:- A SalesLineItem instance sli was created (instance creation).- sli was associated with the current Sale (association formed).- sli.quantity became quantity (attribute modification).- sli was associated with a Produ

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论