道隐于小成,言隐于荣华

软件工程笔记:系统建模

该部分为本科期间软件工程课程笔记备份。

System Modeling introduction(系统建模介绍)

the process of developing abstract models of a system, with each model presenting a different view or perspective of that system.

是开发一个系统的抽象化模型的流程,并且每个模型表示该系统的不同视图或透视图。

representing a system using some kind of graphical notation, which is now almost always based on notations in the Unified Modeling Language (UML).

表示使用某种图形符号的系统,现在几乎总是基于统一建模语言(UML)中的符号。

System modelling helps the analyst to understand the functionality of the system and models are used to communicate with customers.

系统建模帮助分析人员去理解系统的功能,模型用于与客户沟通

Existing and planned system model(现有系统模型与计划系统模型)

Models of the existing system are used during requirements engineering.

在需求工程中使用现有系统的模型

用途:

  1. They help clarify(澄清) what the existing system does and can be used as a basis for discussing its strengths and weaknesses.

它们有助于明确现有的系统做什么,能被作为基础讨论其优势和弱点

  1. These then lead to requirements for the new system.

这就导致了对新系统的需求。

Models of the new system are used during requirements engineering

在需求工程中使用新系统的模型
用途:

  1. help explain the proposed requirements to other system stakeholders.

帮助向其他系统利息相关方解释建议的需求

  1. Engineers use these models to discuss design proposals(建议书) and to document the system for implementation.

工程师使用这些模型来讨论设计提案(建议书)和文件系统的实现。

In a model-driven engineering process:

在模型驱动的工程流程中:

it is possible to generate a complete or partial system implementation from the system model.

可以从系统模型中生成一个完整的或部分的系统实现。

System perspectives(系统的透视)

  • An external(外部) perspective(透视)
    • where you model the context(来龙去脉) or environment of the system.
    • 外部透视:建模系统背景或环境
  • An interaction(内部) perspective
    • where you model the interactions between a system and its environment, or between the components of a system.
    • 在此模型中,您可以对系统及其环境之间或系统组件之间的交互进行建模。
  • A structural perspective(结构化透视)
    • where you model the organization of a system or the structure of the data that is processed by the system.
    • 您可以对系统的组织或系统处理的数据的结构建模。
  • A behavioral perspective(表现透视)
    • where you model the dynamic behavior of the system and how it responds to events.
    • 建模系统的动态行为以及它如何响应事件。

UML diagram types(UML图类型)

  • Activity diagrams(活动图)
    • which show the activities involved in a process or in data processing
    • 显示流程或数据处理中涉及的活动
  • Use case diagrams(用例图)
    • which show the interactions between a system and its environment.
    • 显示系统及其环境之间的交互
  • Sequence diagrams(时序图)
    • which show interactions between actors and the system and between system components.
    • 显示角色与系统以及系统组件之间的交互
  • Class diagrams(类图)
    • which show the object classes in the system and the associations between these classes
    • 显示系统中的对象类以及这些类之间的关联
  • State diagrams(状态图)
    • which show how the system reacts to internal and external events.
    • 显示系统对内部和外部事件的反应

Use of graphical models

As a means(手段) of facilitating(促进) discussion about an existing or proposed(提议的) system

作为一种促进讨论现有或拟议系统的手段

Incomplete and incorrect models are OK as their role is to support discussion.

不完整和不正确的模型是可以纳入讨论的,因为它们的作用是支持讨论。

As a way of documenting an existing system

作为记录现有系统的一种方式

Models should be an accurate(精确的) representation of the system but need not be complete

模型应该是一个精确的系统表示,但它不需要完成

As a detailed system description that can be used to generate a system implementation

作为能用于生成系统实现的详细的系统描述

Models have to be both correct and complete

模型必须是正确和完整的

Context models(背景模型)

目的与用途:illustrate(阐明) the operational context of a system,show what lies outside the system boundaries(显示系统边界之外的内容)

说明系统的操作背景,显示位于系统边界之外的内容

Social and organisational concerns(社会与机构涉及):may affect the decision on where to position system boundaries

社会和组织涉及:可能影响定位系统边界的决定

Architectural models:show the system and its relationship with other systems.

建筑化模型:显示系统以及它与其他系统的关系。

System boundaries(系统边界)

目的与用途:define what is inside and what is outside the system, show other systems that are used or depend on the system being developed.

定义系统内部和外部是什么,显示使用的其他系统或依赖于正在开发的系统。

The position of the system boundary:has a profound(深厚的) effect on the system requirements.

系统边界的地位:对系统需求有深远的影响。

Defining a system boundary is a political judgment

定义系统边界是一种行政判断

Because there may be pressures to develop system boundaries that increase / decrease the influence or workload of different parts of an organization.

因为可能存在开发系统边界的压力,从而增加/减少影响或组织中不同部分的工作量。

eg:

Process perspective(流程透视)

  1. Context models 背景模型
    • simply show the other systems in the environment, not how the system being developed is used in that environment.
    • 简单地显示环境中的其他系统,而不是显示正在开发的系统如何在该环境中使用
  2. Process models 流程模型
    • reveal(显示) how the system being developed is used in broader business processes.
    • 揭示正在开发的系统如何用于广泛的业务流程
  3. UML activity diagrams UML活动图
    • may be used to define business process models.
    • 可能以用来定义业务流程模型

eg: Process model of involuntary detention(自然延迟的过程模型)

avatar

Interaction models(交互模型)

  • Modeling user interaction 用户交互建模
    • important as it helps to identify user requirements.(好处)
    • 重要,因为它有助于识别用户需求。
  • Modeling system-to-system interaction 系统间交互建模
    • highlights the communication problems that may arise.(好处)
    • 强调可能出现的沟通问题
  • Modeling component interaction 组件交互建模
    • helps us understand if a proposed system structure is likely to deliver the required system performance and dependability. (好处)
    • 帮助我们了解所提议的系统结构是否能提供所需的系统性能和可靠性。

Note: Use case diagrams and sequence diagrams may be used for interaction modeling.

注意:使用实例图与时序图可能用作交互建模

Use case modeling 使用实例图

背景: developed originally to support requirements elicitation(引出) and now incorporated(合并) into the UML.

最初被开发以支持需求引出,现在合并到UML

内容:

  • Each use case represents a discrete task(离散的任务) that involves external interaction with a system.
  • 每一个实例代表了一个离散的任务,参与到与系统的额外交互中。
  • Actors in a use case may be people or other systems.
  • 在一个实例图中角色可能是人或者其他系统
  • Represented diagramatically to provide an overview(综述) of the use case and in a more detailed textual(文本的) form.
  • 图像化地被表示,以提供一个使用实例的综述,通过一个更详尽的文本形式

Sequence diagrams 时序图

part of the UML.

UML的一部分

用途:model the interactions between the actors and the objects within a system,shows the sequence of interactions that take place during a particular use case or use case instance(实例).

限于一个系统中角色和对象的交互建模,表现了发生在特别的实例或者使用特殊实例的时序交互

内容:

  • The objects and actors involved are listed along the top of the diagram, with a dotted line drawn vertically from these.
  • 参与的对象和角色被列在图的顶侧,同时用一条虚线垂直地画出来
  • Interactions between objects are indicated by annotated(带标注的) arrows.
  • 物体之间的相互作用是由带标注的箭头反映

Example 例子

Transfer-data use case:

Transfer data Text
Actors 角色 Medical receptionist, patient records system (PRS) 医疗接待员,病人纪录系统(PRS)
Description 描述 A receptionist may transfer data from the MHC-PMS to a general patient record database that is maintained by a health authority. The information transferred may either be updated personal information (address, phone number, etc.) or a summary of the patient’s diagnosis and treatment. 接待员可以将MHC-PMS的数据传输到由卫生当局维护的一般患者记录数据库。所传输的信息可以是最新的个人信息(地址、电话号码等),也可以是患者诊断和治疗的摘要。
Data 数据 Patient’s personal information, treatment summary 患者个人信息,治疗总结
Stimulus(刺激) User command issued by medical receptionist 医疗前台发出的用户命令
Response 响应 Confirmation that PRS has been updated 确认PRS已更新
Comments The receptionist must have appropriate security permissions to access the patient information and the PRS. 接待员必须有适当的安全权限来访问病人信息和PRS。

Sequence diagram for View patient information:
avatar

  1. The medical receptionist triggers(触发) the ViewInfo method in an instance P of the PatientInfo object class, supplying the patient’s identifier, PID. P is a user interface object, which is displayed as a form showing patient information. 在PatientInfo对象的类实例P 中医疗接待员触发ViewInfo 方法,提供病人的标识符,PID。P是一个用户界面对象,它以显示患者信息的形式显示。
  2. The instance P calls the database to return the information required, supplying the receptionist’s identifier to allow security checking(at this stage, we do not care where this PID comes from). 实例P调用数据库返回所需的信息,提供接待员的标识符来允许安全检查(在此阶段,我们不关心PID来自何处)。
  3. The database checks with an authorization system that the user is authorized for this action.数据库使用授权系统检查用户是否被授权执行此操作。
  4. If authorized, the patient information is returned and a form on the user’s screen is filled in. If authorization fails, then an error message is returned.如果得到授权,将返回患者信息并在用户屏幕上填写表单。如果授权失败,则返回一条错误消息。

Sequence diagram for Transfer Data:

  1. The receptionist logs on(登录) to the PRS.接待员登录PRS。
  2. There are two options available. These allow the direct transfer of updated patient information to the PRS and the transfer of summary health data from the MHC-PMS to the PRS.有两个选项可用。这些允许将更新的患者信息直接传输到PRS,并将汇总的健康数据从MHC-PMS传输到PRS。
  3. In each case, the receptionist’s permissions are checked using the authorization system. 在每种情况下,使用授权系统检查前台的权限
  4. Personal information may be transferred directly from the user interface object to the PRS. Alternatively, a summary record may be created from the database and that record is then transferred.个人信息可以直接从用户界面对象传输到PRS。或者,可以从数据库创建一个summary记录,然后传输该记录。
  5. On completion of the transfer, the PRS issues a status message and the user logs off(注销).在完成转会,PRS问题状态消息和用户日志注销。

Structural models 结构化模型

用途:display the organization of a system in terms(关系) of the components that make up that system and their relationships.

依据构成系统和它们之间关系的组件显示系统组织,。

type:

  • static models:show the structure of the system design
  • 静态模型:显示系统的结构设计
  • dynamic models:show the organization of the system when it is executing
  • 动态模型:显示系统的组织执行

使用条件:when you are discussing and designing the system architecture

当您在讨论和设计系统架构时

Class diagrams 类图

使用条件:when developing an object-oriented system model

当开发一个面向对象的系统模型时

目的:show the classes in a system and the associations between these classes.

显示系统中的以及这些类之间的关联

内容:

  • An object class can be thought of as a general definition of one kind of system object.
  • 可以将对象 类看作是一种系统对象的一般定义
  • An association is a link between classes that indicates that there is some relationship between these classes
  • 关联是类之间的链接,该链接表示这些类之间存在某种关系
  • When you are developing models during the early stages of the software engineering process, objects represent something in the real world, such as a patient, a prescription, doctor, etc.
  • 当您在软件工程过程的早期阶段开发模型时,对象表示**真实世界中的某些东西,例如病人、处方、医生等

Each end of the association is annotated(被注解) with a 1, meaning that there is a 1:1 relationship(一对一关系) between objects of these classes. That is, each patient has exactly one record and each record maintains information about exactly one patient.

关联的两端都是箭头横线上如果用1注解,表示这些类的对象之间为一对一关系。也就是说,每个病人只有一条记录,而每条记录都保存着关于一个病人的信息。

avatar

We can define that an exact(准确的) number of objects are involved or by using a *(表明一对多或多对多关系), as shown in this Figure, that there are an indefinite number of objects involved in the association.

我们可以定义一个准确的所涉及的对象数量或通过使用‘*’(表明一对多或多对多关系),如这个图所示,有无数个参与的对象。

This figure develops this type of class diagram to show that objects of class Patient are also involved in relationships with a number of other classes.

该图发展了这种类型的类图,以显示类Patient的对象也涉及到与许多其他类的关系

We can name associations to give the reader an indication of the type of relationship that exists.

我们可以命名关联,以便让读者了解存在的关系类型。

UML also allows the role of the objects participating in the association to be specified.

UML还允许指定参与关联的对象的角色

To define classes in more detail, you add information about their attributes(the characteristics of an object) and operations(the things that you can request from an object).

要更详细地定义类,可以添加关于它们的属性(对象的特征)和操作(可以向对象请求得到的东西)的信息。

In the UML, you show attributes and operations by extending the simple rectangle that represents a class.

在UML中,您通过扩展表示类的简单矩形来显示属性和操作。

  1. The name of the object class is in the top section.
    对象类的名称在顶部

  2. The class attributes are in the middle section. This must include the attribute names and, optionally, their types.
    类属性位于中间部分。这必须包括属性名和它们的类型(可选)。

  3. The operations(called methods in Java and other OO programming languages) associated with the object class are in the lower section of the rectangle.
    与对象类关联的操作(在Java和其他OO编程语言中称为methods)位于矩形的下半部分。

Generalization(泛化,通过继承实现)

an everyday technique that we use to manage complexity.
我们用来管理复杂度的日常技术。

内容:place these entities(实体) in more general classes (animals, cars, houses, etc.) and learn the characteristics of these classes,rather than learn the detailed characteristics of every entity that we experience.将这些实体放置进更一般的类(动物、汽车、房屋等),学习这些类的特点,而不是学习我们经历的每个实体详细特征,。

用途:infer that different members of these classes have some common characteristics e.g. squirrels and rats are rodents 推断这些种类的不同成员有一些共同的特征,例如松鼠和老鼠是啮齿动物

  • In modeling systems:在建模系统中:
    • useful to examine the classes in a system to see if there is scope for generalization. If changes are proposed, then you do not have to look at all classes in the system to see if they are affected by the change.
    • 用于检查系统中的类,看看是否有泛化的余地。如果提出了更改,那么您不必查看系统中的所有类来查看它们是否受到更改的影响。
  • In object-oriented languages: 在面向对象语言中:
    • implemented by using the class inheritance mechanisms built into the language. eg:Java
    • 通过使用该语言内置的类继承机制来实现。如:Java
  • In a generalization 在泛化中:
    • the attributes and operations associated with higher-level classes are also associated with the lower-level classes.
    • 高级类关联的属性和操作也与低级类关联。
    • The lower-level classes are subclasses inherit the attributes and operations from their superclasses. These lower-level classes then add more specific attributes and operations.
    • 较低级别的类继承父类的属性和操作的子类。这些低层类添加更具体的属性和操作

eg. A generalization hierarchy with added detail:

一个添加了细节的泛化层次结构:

In a generalization, the attributes and operations associated with higher-level classes are also associated with the lower-level classes.

概括地说,与高级类关联的属性和操作也与低级类关联。

Object class aggregation(聚合) models 对象类聚合模型

用途: shows how classes that are collections are composed of other classes.

显示集合类如何由其他类组成。

similar to the part-of relationship(局部关系) in semantic(语义) data models.

类似于局部关系(局部关系)在语义(语义)数据模型。

The UML provides a special type of association between classes called aggregation that means that one objects(the whole) is composed(由..组成) of other objects(the parts).

UML提供了在被叫做聚合类的关联的特殊类型,意味着对象们是由其他对象组合而成。

To show this, we use a diamond shape(方形) next to the class that represents the whole.

为了表现这个,我们在紧挨着表示整体的类旁使用一个方形

Behavioral models(行为模型)

models of the dynamic behavior of a system as it is executing.

系统执行时的动态行为模型。

用途:show what happens or what is supposed to happen when a system responds to a stimulus(刺激) from its environment.

显示当一个系统响应来自它的环境的刺激刺激时发生了什么或应该怎样。

stimuli(stimulus复数形式) as being of two types: 两种类型刺激

  • Data: Some data arrives that has to be processed by the system.
  • 数据:必须由系统处理的一些数据到达。
  • Events: Some event happens that triggers system processing. Events may have associated data, although this is not always the case.
  • 事件: 发生一些触发系统处理的事件。事件可能具有关联的数据,但并非总是如此

Data-driven modeling 数据驱动建模

data-processing systems that are primarily driven by data,controlled by the data input to the system, with relatively little external event processing

数据处理系统,主要由数据驱动,基本由数据进行驱动,系统被数据输入控制,伴随相关少量额外事件处理

用途:show the sequence of actions involved in processing input data and generating an associated output.

显示处理输入数据并生成相关输出所涉及的操作时序

使用条件:useful during the analysis of requirements as they can be used to show end-to-end processing in a system.

需求的分析过程中非常有用,因为它们可以用来显示系统中的端到端处理。

Data-flow models(DFDs) are useful because tracking and documenting how the data associated with a particular process moves through the system helps analysts and designers understand what is going on.

数据流模型(dfd)是非常有用的,因为跟踪和记录数据关联到一个特定的过程是如何经过系统帮助分析师和设计师理解发生了什么。

Data-driven modeling example 数据驱动示例

An activity model of the insulin pump’s operation

胰岛素泵工作的活动模型

  • This Figure shows the chain of processing involved in the insulin pump software.
  • 此图显示了胰岛素泵软件中涉及的处理链
  • In this diagram, you can see the processing steps (represented as activities) and the data flowing between these steps(represented as objects).
  • 在这个图中,您可以看到处理步骤(表示为活动)和这些步骤之间的数据流(表示为对象)。

Note:

  • The UML does not support data-flow diagrams as they were originally proposed and used for modeling data processing. The reason for this is that DFDs focus on system functions and do not recognize system objects.
  • UML 不支持数据流图,因为它们最初被提议用于建模数据处理。原因是DFDs 主要关注系统函数,而不识别系统对象
  • However, because data-driven systems are so common in business, UML 2.0 introduced activity diagrams, which are similar to data-flow diagrams.
  • UML 不支持数据流图,因为它们最初被提议用于建模数据处理。原因是DFDs 主要关注系统函数,而不识别系统对象

Order processing: 订单处理

  • This Figure illustrates this, using a sequence model of the processing of an order and sending it to a supplier.
  • 该图说明了这一点,使用订单处理的时序模型并将其发送给供应商。

Note:

  • An alternative way of showing the sequence of processing in a system is to use UML sequence diagrams.
  • 显示系统中处理时序的另一种方法是使用UML 时序图
  • You have seen how these can be used to model interaction but, if you draw these so that messages are only sent from left to right, then they show the sequential data processing in the system.
  • 您已经了解了如何使用这些参数来建模交互,但是,如果您将这些参数绘制为只从左到右发送消息,那么它们将显示系统中的顺序数据处理

Event-driven modeling 事件驱动建模

Real-time systems are often event-driven, with minimal data processing.

实时系统通常是事件驱动的,数据处理很少。

  • eg:a landline phone switching system responds to events such as ‘receiver off hook’ by generating a dial tone. 固定电话交换系统通过产生拨号音来响应诸如“接收机断开连接”之类的事件。

用途:shows how a system responds to external and internal events. 显示系统如何响应外部和内部事件。

使用约束:based on the assumption(假定) that a system has a finite number of states and that events (stimuli) may cause a transition from one state to another

基于假设=系统有有限的 状态数,并且事件(刺激)可能导致**从一种状态过渡到另一种状态

State machine models: 状态机模型:

model the behaviour of the system in response to external and internal events.

为系统的行为建模,以响应外部和内部事件。

用途:show the system’s responses to stimuli so are often used for modelling real-time systems. 显示系统对刺激的反应,因此经常用于建模实时系统

内容:

  • show system states as nodes and events as arcs between these nodes. When an event occurs, the system moves from one state to another.
  • 系统状态显示为节点,将事件显示为这些节点之间的弧。当事件发生时,系统从一个状态移动到另一个状态。
  • Statecharts(状态图表) are an integral part of the UML and are used to represent state machine models.
  • 状态图表是UML的一个组成部分,用于表示状态机模型。

Event-driven modeling example 事件驱动建模示例

State diagram of a microwave oven:

微波炉的状态图

image

  • We assumed that the sequence of actions in using the microware is: 我们假设使用微波炉的操作顺序为:
    1. Select the power level(either half power or full power); 选择功率等级(半功率或全功率);
    2. Input the cooking time using a numeric keypad; 使用数字键盘输入烹饪时间;
    3. Press ‘Start’ and the food is cooked for the given time. 按下“开始”键,食物就会按指定时间煮熟。
State 状态 Description 描述
Waiting 等待 The oven is waiting for input. The display shows the current time. 烤箱正在等待输入。显示器显示当前时间。
Half power 半功率 The oven power is set to 300 watts. The display shows ‘Half power’. 烤箱功率设置为300瓦。显示器显示“半功率”。
Full power 全功率 The oven power is set to 600 watts. The display shows ‘Full power’. 烤箱功率设定为600瓦。显示器显示“满功率”。
Set time 设置时间 The cooking time is set to the user’s input value. The display shows the cooking time selected and is updated as the time is set. 烹饪时间设置为用户的输入值。显示所选择的烹饪时间,并随着时间的设置而更新。
Disabled 受限 Oven operation is disabled for safety. Interior oven light is on. Display shows ‘Not ready’. 为安全起见,禁止烤箱操作。烤箱内部灯亮着。显示“未准备好”。
Enabled 启用 Oven operation is enabled. Interior oven light is off. Display shows ‘Ready to cook’. 启用烘箱操作。烤箱内部的灯是关闭的。显示“准备好烹饪”。
Operation 操作 Oven in operation. Interior oven light is on. Display shows the timer countdown. On completion of cooking, the buzzer is sounded for five seconds. Oven light is on. Display shows ‘Cooking complete’ while buzzer is sounding. 烤箱在操作。烤箱内部灯亮着。显示计时器倒计时。烹饪完成后,蜂鸣器会响起五秒钟。烤箱灯亮着。显示屏显示“烹饪完成”,同时蜂鸣器响起。

Microwave oven operation:

problem with state-based modeling: 基于状态建模缺陷

  • the number of possible states increases rapidly.
  • 可能的状态数迅速增加

For large system models, therefore, you need to hide detail in the models.

因此,对于大型系统模型,您需要在模型中隐藏细节

solution: 解决

For large system models, therefore, you need to hide detail in the models.
因此,对于大型系统模型,您需要在模型中隐藏细节

One way to do this is by using the notion of a superstate(超级陈述) that encapsulates a number of separate states. 这样做的方法之一是通过使用超级陈述,封装了一个独立的状态。

This superstate looks like as single state on a high-level model but is then expanded to show more detail on a separate diagram. 这个超状态看起来像高级模型上的单个状态,但是随后被扩展为在一个单独的图上显示更多的细节

Model-driven engineering(MDE) 模型驱动工程

an approach to software development where models rather than programs are the principal outputs of the development process.

一种软件开发方法,其中模型开发过程的主要输出,而不是程序。

programs that execute on a hardware/software platform are then generated automatically from the models.

在硬件/软件平台上执行的程序将从模型中自动生成

Proponents(支持者) of MDE argue that this raises the level of abstraction in software engineering so that engineers no longer have to be concerned with programming language details or the specifics of execution platforms.

MDE支持者认为,这就提出了一个抽象层次在软件工程中,工程师们不再需要关心编程语言细节或具体的执行平台。

Usage of model-driven engineering 模型驱动工程的使用

目前的进展:

  • still at an early stage of development
  • 依旧在早期开发阶段
  • it is unclear whether or not it will have a significant effect on software engineering practice.
  • 目前还不清楚它是否会对软件工程实践产生重大影响。

Pros(支持观点,可当作好处):

  1. Allows systems to be considered at higher levels of abstraction 允许在更高的抽象级别上考虑系统
  2. Generating code automatically means that it is cheaper to adapt systems to new platforms. 自动生成代码意味着使系统适应新平台的成本更低。

Cons(反对观点,可当作问题):

  1. Models for abstraction and not necessarily right for implementation. 抽象的模型,不一定适合实现。
  2. Savings from generating code may be outweighed by the costs of developing translators for new platforms. 为新平台开发翻译程序的成本可能会超过生成代码所节省的成本。

Model driven architecture 模型驱动架构

MDA:

  • the precursor of more general model-driven engineering
  • 更一般的模型驱动工程的先驱
  • a model-focused approach to software design and implementation that uses a subset of UML models to describe a system.
  • 以模型为中心的软件设计和实现方法,使用UML模型的子集来描述系统。

Models at different levels of abstraction are created. From a high-level, platform independent model, it is possible, in principle, to generate a working program without manual intervention.

不同抽象级别上创建模型。从一个高级的、独立于平台的模型来看,原则上可以在不需要人工干预的情况下生成一个工作程序。

Types of model 类型的模型

  1. A computation independent model (CIM) 计算独立模型(CIM)
    • model the important domain abstractions used in a system. CIMs are sometimes called domain models
    • 为系统中使用的重要领域抽象建模。CIMs有时称为域模型
  2. A platform independent model (PIM) 平台独立模型(PIM)
    • model the operation of the system without reference to its implementation. The PIM is usually described using UML models that show the static system structure and how it responds to external and internal events.
    • 在不参考系统实现的情况下对系统的运行进行建模。PIM通常使用UML模型来描述,该模型显示静态系统结构以及它如何响应外部和内部事件。
  3. Platform specific models (PSM) 平台特定模型
    • These are transformations(转变) of the platform-independent model with a separate PSM for each application platform. In principle, there may be layers of PSM, with each layer adding some platform-specific detail.
    • 这些伴随一个单独的PSM为每个应用程序平台,独立于平台的模型的转换(转变)。原则上,可以有多个PSM层,每个层都添加一些特定于平台的细节。

MDA transformations:

Multiple platform-specific models:

Agile methods and MDA 敏捷方法与MDA

The developers of MDA claim that MDA is intended to support an iterative approach to development and so can be used within agile methods.

MDA的开发人员声称MDA旨在支持迭代开发方法,因此可以在敏捷方法中使用。

The notion of extensive up-front modeling contradicts the fundamental ideas in the agile manifesto and I suspect that few agile developers feel comfortable with model-driven engineering.

广泛的预先建模的概念与敏捷构想中的基本思想相矛盾,我怀疑很少有敏捷开发人员对模型驱动的工程感到满意。

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 as no separate coding would be required.

如果转换可以完全自动化,并且可以从PIM生成完整的程序,那么,在原则上,MDA可以在敏捷开发过程中使用,因为不需要单独的编码。

Executable UML 可执行的UML

The fundamental notion behind model-driven engineering is that completely automated transformation of models to code should be possible.
This is possible using a subset of UML 2, called Executable UML or xUML.

在模型驱动工程背后的基本概念下,模型到代码的完全自动化转换应该是可能的。
这可以使用UML 2的一个子集,称为可执行UMLxUML

Features of executable UML: 可执行的UML的特点:

  • the number of model types has therefore been dramatically reduced to these 3 key types:
  • 因此,模型类型的数量已大大减少到以下3种关键类型:
    1. Domain models that identify the principal concerns in a system. They are defined using UML class diagrams and include objects, attributes and associations. 确定系统中主要关注点的域模型。它们使用UML类图定义,包括对象、属性和关联。
    2. Class models in which classes are defined, along with their attributes and operations. 类模型,其中定义了类及其属性和操作。
    3. State models in which a state diagram is associated with each class and is used to describe the life cycle of the class. 状态模型,其中状态图与每个类相关联,用于描述类的生命周期。

The dynamic behavior of the system may be specified declaratively using the object constraint language (OCL), or may be expressed using UML’s action language.

系统的动态行为可以使用对象约束语言(OCL)声明性地指定,也可以使用UML的动作语言表示。

Thanks

Prof.Chen

posted @ 2022-05-06 11:26  FrancisQiu  阅读(86)  评论(0)    收藏  举报