3.2 面向对象分析(一)名词法

Analysis Phase分析阶段

   在软件工程,分析是一种过程,把用户需求转变为系统需求

   系统规格说明,也称为逻辑结构,是开发人员眼中的系统

     已经有了哪些业务规则、业务逻辑?

     还有哪些事需要提醒客户的?

   大的、复杂系统的开发,有两种主要的分析方法

     面向功能的分析Function-oriented analysis

       concentrating on the decomposition of complex functions to simply ones.

     面向对象分析Object-oriented analysis

       identifying objects and the relationship between objects.

     在抽象层面,面向功能的分析法用得多一点

       把系统分成模块

     在模块层面,面向对象分析法用得多一点

       模块的功能如何实现?--- OOAD技术!
     从“用户的角度”到“开发人员的角度”之间的差异

      

Object Oriented Analysis 面向对象分析主要步骤

   Identifying objects 识别对象

   Organising the objects: 组织对象

     classifying the objects identified, so similar objects can later be defined in the same class.

   Identifying relationships between objects: 定义对象之间的关系

     this helps to determine inputs and outputs of an object.

   Defining operations of the objects: 定义对象的操作

     the way of processing data within an object.

     Also known as ‘responsibility assignment’

     这一步,主要在设计阶段完成

   Defining objects internally: 定义对象内部细节

     information held within the objects.
Three ways to do Object Oriented Analysis (there are more…)
   1)Conceptual model (Larman) 概念模型,又称“名词法”

     Produce a “light” class diagram

   2)Analysis model with stereotypes (Jacobson) 分析模型

     Boundaries, entities, control.

   3)CRC cards (Beck, Cunningham) CRC法,类/职责/协作

     Index cards and role playing.
   A good analyst knows more than one strategy and even may mix strategies in order to identify the objects and relationships for the design      phase.

    一个好的分析师掌握多种技术,知道如何混合使用各种技术。目标只有一个: 发现对象、定义对象之间的关系。
概念模型

   概念模型 conceptual model 表示了问题领域的的 “概念”及其关系,也称 为领域模型 ‘domain model’

   UML图形表示为 “没有定义操作的类图”

     它能够显示:概念 Concepts、概念之间的关系 Associations of concepts、概念的属性 Attributes of concepts

      

名词法定义概念类

   名词法定义概念(conceptual class)

     重用或者修改已有的模型 Reuse or modify existing models.

       This is the first, best, and usually easiest approach

     借助行业、公司内部法的“概念类列表 ” Concept Category List

     在需求描述中查寻名词(短语)Finding Concepts with Noun Phrase Identification.


    复习: 面向对象分析与结构化分析方法之间的最大差异是 A central distinction between object oriented and structures analysis:

       前者根据对象划分系统,而后者根据功能 division by concepts (objects) rather than division by functions.
概念类列表 The Concept Category List Table

  

Finding Concepts with Noun Phrase Identification 名词短语法

   方法

     在问题领域的文本描述中,标识出名词、名词短语,把它们作为候选的概念类或者属性 Identify the noun and noun phrases in textual         descriptions of a problem domain and consider them as candidate concepts or attributes

     对发现的名称(短语)进行分析,辨别是合适的概念类吗?概念可以合并吗?等等

     定义概念类之间的关系

     定义概念类的属性

   注意

     不能机械地转换“名称 ----> 概念类”

     自然语言描述的文字有歧义、重复、一词多意、一意多词等,要仔细分析

     比如英语,复数一般就不需要了,students\student, 只要student即可
小结

   领域(用户的角度)、系统(开发人员的角度)

   概念模型 == 领域模型  概念类 == 领域概念

   如何寻找、定义领域内的概念类?

   方法一:名称法

     利用已有

     查找概念类列表

     从问题描述中寻找名词、名词短语,进行分析

   方法二:分析模型法

   方法三:CRC法

猜你喜欢

转载自www.cnblogs.com/mayZhou/p/10536674.html
3.2