Chapter5:System Modeling:SE_Notes《软件工程》笔记

文章目录

  • Chapter5:System Modeling
    • 5.1 brief
      • 5.1.1 System modeling
      • 5.1.2 UML
    • 5.2 Things
      • 5.2.1 Structural thing: Class
      • 5.2.2 Structural thing: Interface
      • 5.2.3 Structural thing: Components
      • 5.2.4 Behavioral thing: Interaction
      • 5.2.5 Grouping thing: Package
      • 5.2.6 Comment thing: Comment
    • 5.3 Relationships
      • 5.3.1 Association
      • 5.3.2 Generalization
      • 5.3.3 Dependency
      • 5.3.4 Realization
    • 5.4 Diagrams
    • 5.5 Models
      • 5.5.1 Context models & System boundaries
      • 5.5.2 Process models & activity diagram
      • 5.5.3 Interaction models
      • 5.5.4 Structural models
      • 5.5.5 Aggregation model
      • 5.5.6 Behavioral models
      • 5.5.7 Data-driven modeling
      • 5.5.8 Activity model
      • 5.5.9 Event-driven modeling
      • 5.5.10 State machine models
    • 5.6 Model-driven architecture(MDA)
      • 5.6.1 brief
      • 5.6.2 types of model
      • 5.6.3 Agile methods and MDA
      • 5.6.4 Executable UML

Chapter5:System Modeling

5.1 brief

5.1.1 System modeling

  • Topics covered

  • UML中各类模型适用于:

    use cases and actors:用例图:系统边界和主要功能

    interaction diagrams:交互图:用例的实现

    class diagrams :类图:系统静态结构

    state transition diagrams:状态转移图:对象行为

    component & deployment diagrams :组件/实施图:物理实现

    stereotypes:构造型:可扩展功能

  • UML里的4种基本元素:

5.2.2 Structural thing: Interface

  • 描述了一个类or组件的外部行为。

    两种描述方式:1. 简化描述 2. 以interface类的形式来描述

5.2.4 Behavioral thing: Interaction

  • 两个对象之间的通讯。

    例图表示:存在一个由Company发起的对Person的交互Assign

5.2.6 Comment thing: Comment

? 注释事务。

  • 聚合Aggregation 和 组合Composition

    他们都属于:关联关系 association

    聚合和组合都是:整体和部分的关系,a-part-of 关系。

    1. 聚合:如何没有这样一个部分,整体依然存在。空心菱形。
    2. 5.3.3 Dependency

    • 依赖关系:虚线箭头。表示一个事物,会受另外一个事务的影响。

    • CourseSchedule会依赖于Course【参数】,Iterator依赖于CourseSchedule【友元】

    5.4 Diagrams

    • Diagrams:

      Be made of things and relationships.
      Use case diagram, class diagram, sequence diagrams … and other diagrams.

    • 将Things用Relationship联系起来,就形成了Diagrams

    • 不同的Diagrams可以为不同的model服务

    • System perspectives 观察系统的角度

    5.5 Models

    5.5.1 Context models & System boundaries

    Context models:

    反映一个系统的边界情况,和其他系统之间的关系,在整体环境中的所处位置。

    5.5.2 Process models & activity diagram

    过程模型:揭示大量的业务处理过程是。用UML中的activity diagram来做process model

    5.5.3 Interaction models

    • Interaction models 两类:

      1. Modeling system-to-system interaction :use case diagram

      2. Modeling component interaction :sequence diagram

    • Use case models

      1. 用例最初是为了支持需求捕获Requirements elicitation而开发的,现在被合并到UML中。

      2. 每个用例代表一个离散的任务discrete task,它涉及到与系统的外部交互。

      3. 用例中的参与者Actors可能是人people或其他系统other systems。

      4. 用图表的形式表示,以提供用例的概述,并以更详细的文本形式表示。

      例子:

      Medical receptionist 发起交互,目标是Transfer data;Transfer data 发起交互,Patient record system是接收方,接收方一定有对应的接口。

    • Sequence diagrams

      components in system;actors和objects之间的交互。

      时序图,是在特定用例执行的时候,发生在期间的交互的顺序。

      一个用例是一个粗粒度的、概要性的功能描述,通过若干个组件和对象来协作完成用例的功能。

      序列图展现的就是若干个组件和实体以及actors之间的顺序交互,实现这个用例的过程。

      例子:Sequence diagram for View patient information

    • Generalization

      用泛化关系,来描述OO中父类子类的继承关系。减少复杂性manage complexity。

      例子:

      类图1:描述父类doctor和各个子类的继承关系

    5.5.5 Aggregation model

    5.5.8 Activity model

    描述业务处理过程可以采用数据处理模型or时序模型,前者:工作流的顺序,后者:实体间的协作顺序。

  • 5.5.9 Event-driven modeling

  • Model driven architecture(MDA)

    模型驱动的体系结构MDA,通过UML建模来产生一个Model

    可以构建不同层次的抽象模型。

    若构建的UML模型满足形式化的,有附加精确的数学定义,则可以自动出来程序

  • 5.6.2 types of model

    • Types of model

      CIM:问题域层次的抽象

      PIM:独立于实现平台,不管我是采用J2EE还是.NET。

      PSM:特定平台模型,主要是在PIM的基础上加入了特定平台的一些细节

    • 从高层抽象的独立模型到可执行代码的过程

    5.6.3 Agile methods and MDA

    如果一个程序可以通过PIM完全自动生成,那么原则上这个程序可以用于敏捷开发。

    If transformations can be completely automated and a complete program generated from a PIM, then, in principle, MDA could be used in an agile development process

    5.6.4 Executable UML

    • Executable UML

      前面讲的都属于半形式化模型。光靠这样的模型还不能自动生成代码completely automated transformation ,还需要加一些形式化的定义。

      UML发展到UML2,UML2 + OCL(对象约束语言) = xUML(可执行UML)

      xUML是UML的一个子集。

    • Features of executable UML

      Chapter5:System Modeling:SE_Notes《软件工程》笔记

    声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

    上一篇 2020年2月21日
    下一篇 2020年2月21日

    相关推荐