软件工程系统模型_第1页
软件工程系统模型_第2页
软件工程系统模型_第3页
软件工程系统模型_第4页
软件工程系统模型_第5页
已阅读5页,还剩39页未读 继续免费阅读

下载本文档

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

文档简介

1、陈江平Software Engineering, 8th edition. Chapter 8 Slide 1第8章 系统模型陈江平Software Engineering, 8th edition. Chapter 8 Slide 2目标l理解为什么确立系统的边界和对系统在上下文建模是重要的;l理解行为建模、数据建模和对象建模等概念;l介绍统一建模语言(UML)中定义的一些符号;l理解CASE 工作台是如何支持系统建模的。陈江平Software Engineering, 8th edition. Chapter 8 Slide 3内容l上下文建模l行为模型l数据模型l对象模型l结构化方法陈江

2、平Software Engineering, 8th edition. Chapter 8 Slide 4系统建模l系统建模有助于分析者增进对系统功能的理解,这些模型用来与客户进行通信。l不同的模型从不同的视角去表述系统:从外部来看,它是对系统上下文或系统环境建模。从行为上看,它是对系统行为建模;从结构上看,它是对系统的体系结构和系统处理的数据的结构建模。陈江平Software Engineering, 8th edition. Chapter 8 Slide 5系统模型类型l数据流模型 说明在系统的不同阶段数据是如何被处理的。l组成模型 说明系统中的实体是如何由其他实体组成的。l体系结构模型

3、 说明主要的子系统。l分类模型 说明实体间怎样具有共同特性。l激励-响应模型 说明系统对来自内部和外部的事件的响应。陈江平Software Engineering, 8th edition. Chapter 8 Slide 6上下文模型( Context models )l在需求导出和分析过程的早期阶段,应该首先界定系统的边界,与系统信息持有者一起明确系统是什么以及系统的环境是什么。l社会性和组织性的关注可能会影响系统边界的决定。l体系结构模型描述系统的环境,不描述其他子系统之间的关联关系,也不描述要分析的系统本身。陈江平Software Engineering, 8th edition. C

4、hapter 8 Slide 7ATM系统的上下文陈江平Software Engineering, 8th edition. Chapter 8 Slide 8过程模型( Process models )l过程模型给出系统中支持的各种活动,这些活动是系统所支持的。l数据流模型给出数据如何在系统间传输。陈江平Software Engineering, 8th edition. Chapter 8 Slide 9设备采购的过程模型陈江平Software Engineering, 8th edition. Chapter 8 Slide 10行为模型( Behavioural models )l行为

5、模型用来描述系统的所有行为。l两类行为模型:数据流模型,用来描述系统中的数据处理过程 ;状态机模型,用以描述系统如何对事件做出响应 。l这两种模型显示了系统的不同方面,所以两者都被用来描述系统的行为。陈江平Software Engineering, 8th edition. Chapter 8 Slide 11数据处理模型l数据流图 (DFDs) 用来建模系统的数据处理方式。l数据流模型用来描述数据是怎样一步步在处理序列中流动的。l数据流模型是许多分析方法中的固有部分。l数据流图使用的是一些浅显易懂的符号。l数据流模型展示了系统中端到端的处理过程。陈江平Software Engineering

6、, 8th edition. Chapter 8 Slide 12订单处理的数据流图陈江平Software Engineering, 8th edition. Chapter 8 Slide 13数据流图( Data flow diagrams )l数据流模型(DFDs model)是从功能角度来看待系统而得到的模型表示 。l数据流模型的价值主要体现在它对系统中的数据和数据在特定的过程中的流动的跟踪和记录,有助于系统分析人员理解系统中到底发生了什么。l数据流图也可以用来显示一个系统在它的环境中,与其他系统进行的数据交换。陈江平Software Engineering, 8th edition.

7、 Chapter 8 Slide 14胰岛素泵中的数据流图陈江平Software Engineering, 8th edition. Chapter 8 Slide 15状态机模型( State machine models )l状态机模型是一种描述系统对内部或外部事件响应的行为模型。l这种模型适合用来描述实时系统,因为这类系统多是由外界环境的刺激而驱动的。l状态机模型用节点表示系统状态,用节点之间的弧来表示事件。当一个事件发生的时候,系统从一个状态转移到一个新的状态。l状态图表(Statecharts)是UML中的主要部分,经常用来描述状态机模型 。陈江平Software Engineeri

8、ng, 8th edition. Chapter 8 Slide 16状态图表( Statecharts )l它允许将一个模型分解成多个子模型(见下一页);l在某个状态内以“do”开头的一个简单的动作描述表示在该状态下系统的行为。l状态图可以用表格加以补充,来描述状态和激励。陈江平Software Engineering, 8th edition. Chapter 8 Slide 17简单微波炉的状态机模型陈江平Software Engineering, 8th edition. Chapter 8 Slide 18微波炉状态描述StateDescriptionWaitingThe oven

9、is waiting for input. The display shows the current time.Half powerThe oven power is set to 300 watts. The display shows H alf power .Full powerThe oven power is set to 600 watts. The display shows F ull power .Set timeThe cooking time is set to the user s input value. The display shows the cooking

10、timeselected and is updated as the time is set.DisabledOven operation is disabled for safety. Interior oven light is on. Display shows N otready .EnabledOven operation is enabled. Interior oven light is off. Display shows Ready to cook .OperationOven in operation. Interior oven light is on. Display

11、shows the timer countdown. Oncompletion of cooking, the buzzer is sounded for 5 seconds. Oven light is on. Displayshows Cooking complete w hile buzzer is sounding.陈江平Software Engineering, 8th edition. Chapter 8 Slide 19微波炉激励描述StimulusDescriptionHalf powerThe user has pressed the half power buttonFul

12、l powerThe user has pressed the full power buttonTimerThe user has pressed one of the timer buttonsNumberThe user has pressed a numeric keyDoor openThe oven door switch is not closedDoor closedThe oven door switch is closedStartThe user has pressed the start buttonCancelThe user has pressed the canc

13、el button陈江平Software Engineering, 8th edition. Chapter 8 Slide 20微波炉操作陈江平Software Engineering, 8th edition. Chapter 8 Slide 21语义数据模型l语义数据模型( Semantic data models )用来描述系统处理的数据的逻辑结构。l最广泛采用的数据建模技术是实体-关系-属性建模,它描述数据实体、关联属性以及实体之间的关系。l实体-关系模型在数据库设计中被广泛采用。使用关系型数据库,它很容易得到实现 。lUML没有为此模型引进专门的描述符号,其开发过程和模型数据用对象

14、和对象间的关系来表达。陈江平Software Engineering, 8th edition. Chapter 8 Slide 22LIBSYS系统的语义数据模型陈江平Software Engineering, 8th edition. Chapter 8 Slide 23数据字典l数据字典(Data dictionaries)是系统的模型中出现的所有名字的罗列,除名字之外还包括对有关命令实体,关系和属性的描述 。l优点它支持名字管理,避免了名字被重用;作为连接软件分析、设计、实现和进化各阶段的开发机构的信息存储。l许多支持系统建模的 CASE 工具也支持数据字典。陈江平Software E

15、ngineering, 8th edition. Chapter 8 Slide 24数据字典实体的例子NameDescriptionTypeDateArticleDetails of the published article that may be ordered bypeople using LIBSYS.Entity30.12.2002authorsThe names of the authors of the article who may be duea share of the fee.Attribute30.12.2002BuyerThe person or organisat

16、ion that orders a co py of thearticle.Entity30.12.2002fee-payable-toA 1:1 relationship between Article and the CopyrightAgency who should be paid the copyright fee.Relation29.12.2002Address(Buyer)The address of the buyer. This is used to any paperbilling information that is required.Attribute31.12.2

17、002陈江平Software Engineering, 8th edition. Chapter 8 Slide 25对象模型l对象模型(Object models)用对象类和它们的关系来描述系统 l对象类是对具有相同属性、服务和操作的一组对象的抽象。l不同的对象模型有:继承模型(Inheritance models);聚合模型(Aggregation models);交互模型(Interaction models)。陈江平Software Engineering, 8th edition. Chapter 8 Slide 26对象模型l对象模型是一种映射真实世界中实体及其操作的自然方式。l实

18、体越抽象,用这种方法来建模就越困难。l对象类识别被看作是一个很难的过程,它需要对应用领域有一个深层次的理解。l反映应用领域实体的对象类是可以通过系统复用的。陈江平Software Engineering, 8th edition. Chapter 8 Slide 27继承模型l继承模型把领域对象类组织成一个层次结构。l最一般的对象类居于层次关系的顶端。l较专门的对象类既继承通用类中的属性和服务,又具有自身的属性和服务。l设计类层次不是件容易的事,分析人员需要对所要分析的领域有充分的了解。陈江平Software Engineering, 8th edition. Chapter 8 Slide

19、28对象模型和 UMLlUML是由开发人员集成的一种标准表示,广泛应用于面向对象的分析和设计方法中。lUML已经成为了对象建模的标准。l符号上面一栏是对象类的名字,中间一栏是对象类的属性,下面一栏是对象类中的操作;对象类之间的关系(称为关联)用线路连接对象来表示;继承是指泛化关系,在继承图中使用“向上”而不是“向下”的箭头来表示。陈江平Software Engineering, 8th edition. Chapter 8 Slide 29图书馆系统的部分类层次陈江平Software Engineering, 8th edition. Chapter 8 Slide 30用户类层次陈江平Sof

20、tware Engineering, 8th edition. Chapter 8 Slide 31多重继承l多重继承是一个对象可以同时从多个类继承属性和操作,这样它的属性就是所有父类的属性和操作的和。l这可能会导致语义冲突,也就是在不同的超类中,有相同的名字的属性或服务有不同的语义。l多继承使得类的层次组织更复杂。陈江平Software Engineering, 8th edition. Chapter 8 Slide 32多重继承陈江平Software Engineering, 8th edition. Chapter 8 Slide 33对象聚合l聚合模型( Aggregation mo

21、dels )显示了对象类是如何由其他一组对象组合而成的 。l聚合模型类似于语义数据模型中的部分-整体关系。陈江平Software Engineering, 8th edition. Chapter 8 Slide 34表示课程的聚合对象陈江平Software Engineering, 8th edition. Chapter 8 Slide 35对象行为建模l行为模型(behavioural model)显示了对象是如何与其他对象进行交互来产生某种特殊的系统行为的,可以用用例来描述。l在UML中,序列图(Sequence diagrams) 能描述在用例当中所包含的动作的序列,协作图( col

22、laboration diagrams )描述在对象间所交换的消息的序列。陈江平Software Engineering, 8th edition. Chapter 8 Slide 36电子科目的发放陈江平Software Engineering, 8th edition. Chapter 8 Slide 37结构化方法l结构化方法(Structured methods )是一种系统建模方法,对现有系统和将要建立的系统建立模型。l方法定义一系列模型,一个过程,借此能到处这些模型,还有可以应用于模型的一组规则和方针。lCASE 工具作为结构化方法的一部分,支持系统建模 。陈江平Software Engineering, 8th edition. Chapter 8 Slide 38结构化方法的弱点l它们不能对非功能系统需求的理解和建模提供有效支持。l它们是难以区分的,因为它们不总是能包括一些方针来帮助用户确定是否一个方法适合他们的特殊问题。l它们通常产生大量的文档。l所产生的模型粒度太细,用户通常发现这些模型很难理解

温馨提示

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

评论

0/150

提交评论