📜  OOAD-面向对象的分析

📅  最后修改于: 2020-12-14 04:07:55             🧑  作者: Mango


在软件开发的系统分析或面向对象分析阶段,确定系统需求,确定类别并确定类别之间的关系。

相互结合用于面向对象分析的三种分析技术是对象建模,动态建模和功能建模。

对象建模

对象建模根据对象来开发软件系统的静态结构。它标识对象,可以将对象分组到的类以及对象之间的关系。它还标识了每个类的主要属性和操作。

对象建模的过程可以在以下步骤中可视化-

  • 识别对象并分组为类
  • 确定班级之间的关系
  • 创建用户对象模型图
  • 定义用户对象属性
  • 定义应该在类上执行的操作
  • 复习词汇

动态建模

在分析了系统的静态行为之后,需要检查其关于时间和外部变化的行为。这是动态建模的目的。

动态建模可以定义为“一种描述单个对象如何响应事件的方法,这些事件是由其他对象触发的内部事件,还是由外界触发的外部事件”。

动态建模的过程可以在以下步骤中可视化-

  • 识别每个对象的状态
  • 识别事件并分析动作的适用性
  • 构造动态模型图,包括状态转移图
  • 用对象属性表达每个状态
  • 验证绘制的状态转换图

功能建模

功能建模是面向对象分析的最后组成部分。功能模型显示了在对象内执行的过程以及数据在方法之间移动时的变化方式。它指定了对象建模操作和动态建模操作的含义。功能模型对应于传统结构分析的数据流程图。

功能建模的过程可以在以下步骤中可视化-

  • 识别所有输入和输出
  • 构建显示功能依赖关系的数据流程图
  • 说明每个函数的目的
  • 识别约束
  • 指定优化标准

结构化分析与面向对象的分析

结构分析/结构设计(SASD)方法是基于瀑布模型的传统软件开发方法。使用SASD开发系统的阶段是-

  • 可行性研究
  • 需求分析与规范
  • 系统设计
  • 实作
  • 实施后审查

现在,我们将研究结构化分析方法和面向对象分析方法的相对优缺点。

面向对象分析的优点/缺点

Advantages Disadvantages
Focuses on data rather than the procedures as in Structured Analysis. Functionality is restricted within objects. This may pose a problem for systems which are intrinsically procedural or computational in nature.
The principles of encapsulation and data hiding help the developer to develop systems that cannot be tampered by other parts of the system. It cannot identify which objects would generate an optimal system design.
The principles of encapsulation and data hiding help the developer to develop systems that cannot be tampered by other parts of the system. The object-oriented models do not easily show the communications between the objects in the system.
It allows effective management of software complexity by the virtue of modularity. All the interfaces between the objects cannot be represented in a single diagram.
It can be upgraded from small to large systems at a greater ease than in systems following structured analysis.

结构化分析的优缺点

Advantages Disadvantages
As it follows a top-down approach in contrast to bottom-up approach of object-oriented analysis, it can be more easily comprehended than OOA. In traditional structured analysis models, one phase should be completed before the next phase. This poses a problem in design, particularly if errors crop up or requirements change.
It is based upon functionality. The overall purpose is identified and then functional decomposition is done for developing the software. The emphasis not only gives a better understanding of the system but also generates more complete systems. The initial cost of constructing the system is high, since the whole system needs to be designed at once leaving very little option to add functionality later.
The specifications in it are written in simple English language, and hence can be more easily analyzed by non-technical personnel. It does not support reusability of code. So, the time and cost of development is inherently high.