UML復習
UML復習
1. What is a Use-Case Model?
英文答案:
A Use-Case Model is:
• A model that describes a system’s functional requirements in terms of use cases.
• A model of the system’s intended functionality (use cases) and its environment (actors).
中文答案:
用例模型是:
• 一种以用例的形式描述系统功能需求的模型。
• 一种描述系统预期功能(用例)及其环境(参与者)的模型。
2. What is an Actor?
英文答案:
An actor represents anything that interacts with the system.
中文答案:
参与者是指与系统交互的任何事物。
3. What is a Use Case? List examples of use case properties.
英文答案:
A use case is:
• A sequence of actions a system performs that yields an observable result of value to a particular actor.
Examples of use case properties:
• Name: A unique identifier for the use case.
• Actors: The external entities interacting with the use case.
• Preconditions: Conditions that must be true before the use case can start.
• Postconditions: Conditions that must be true after the use case is completed.
• Primary Flow: The main sequence of events in the use case.
• Alternate Flow: Variations or exceptional flows of the use case.
• Exceptions: Errors or unexpected conditions that may occur during the use case.
中文答案:
用例是:
• 系统执行的一系列动作,为特定参与者产生可观察且有价值的结果。
用例属性示例:
• 名称 (Name): 用例的唯一标识符。
• 参与者 (Actors): 与用例交互的外部实体。
• 前置条件 (Preconditions): 用例开始前必须满足的条件。
• 后置条件 (Postconditions): 用例完成后必须满足的条件。
• 主流程 (Primary Flow): 用例中的主要事件序列。
• 备选流程 (Alternate Flow): 用例的变体或异常流程。
• 异常 (Exceptions): 用例执行过程中可能发生的错误或意外情况。
4. What is the difference between a use case and a scenario?
英文答案:
• Use Case: A use case is a general description of a system’s functionality, representing all possible interactions between the system and its actors.
• Scenario: A scenario is an instance of a use case, describing a specific sequence of interactions between the system and its actors.
中文答案:
• 用例 (Use Case): 用例是对系统功能的总体描述,表示系统与其参与者之间所有可能的交互。
• 场景 (Scenario): 场景是用例的一个实例,描述系统与其参与者之间的特定交互序列。
5. What is a Supplementary Specification and what does it include?
英文答案:
A Supplementary Specification is a document that complements the use-case model by providing additional details about the system’s requirements.
It includes:
• Functionality: Additional functional requirements not covered in the use cases.
• Usability: Requirements related to the user interface and user experience.
• Reliability: Requirements for system availability, fault tolerance, and recovery.
• Performance: Requirements for system speed, responsiveness, and scalability.
• Supportability: Requirements for system maintenance, updates, and support.
• Design Constraints: Technical or environmental constraints that affect the system design.
• Supplementary Information: Any additional information relevant to the system’s requirements.
中文答案:
补充规格说明 (Supplementary Specification) 是一份补充用例模型的文档,提供有关系统需求的附加细节。
它包括:
• 功能性 (Functionality): 用例中未涵盖的附加功能需求。
• 可用性 (Usability): 与用户界面和用户体验相关的需求。
• 可靠性 (Reliability): 系统可用性、容错能力和恢复能力的需求。
• 性能 (Performance): 系统速度、响应能力和可扩展性的需求。
• 可支持性 (Supportability): 系统维护、更新和支持的需求。
• 设计约束 (Design Constraints): 影响系统设计的技术或环境约束。
• 补充信息 (Supplementary Information): 与系统需求相关的任何附加信息。
总结表格
问题编号 | 英文问题 | 中文问题 | 答案 | 解释 (Explanation) |
---|---|---|---|---|
1 | What is a Use-Case Model? | 什么是用例模型? | 用例模型描述系统的功能需求,表示系统的预期功能和与其交互的环境。 | 用例模型是系统的功能需求和参与者交互的抽象描述。 |
2 | What is an actor? | 什么是参与者? | 参与者是与系统交互的任何事物。 | 参与者可以是用户、外部系统或其他实体。 |
3 | What is a use case? List examples of use case properties. | 什么是用例?列出用例的属性示例。 | 用例是系统执行的一系列动作,为特定参与者产生可观察且有价值的结果。 | 用例属性包括名称、参与者、前置条件、后置条件、主流程、备选流程和异常等。 |
4 | What is the difference between a use case and a scenario? | 用例和场景有什么区别? | 用例是系统功能的总体描述,场景是用例的一个实例,描述特定的交互序列。 | 用例是抽象的功能描述,场景是具体的交互实例。 |
5 | What is a Supplementary Specification and what does it include? | 什么是补充规格说明?它包括什么? | 补充规格说明提供系统需求的附加细节,包括功能性、可用性、可靠性、性能、可支持性、设计约束和补充信息。 | 补充规格说明是对用例模型的补充,提供更详细的需求描述。 |
复习建议
用例模型 (Use-Case Model):
• 理解用例模型的作用,掌握如何通过用例描述系统功能。
• 区分用例和场景,明确用例是抽象描述,场景是具体实例。参与者 (Actor):
• 参与者可以是用户、外部系统或其他实体,理解其与系统的交互关系。用例 (Use Case):
• 掌握用例的定义和属性,能够列出用例的常见属性(如前置条件、后置条件、主流程等)。补充规格说明 (Supplementary Specification):
• 理解补充规格说明的作用,能够列举其包含的内容(如功能性、性能、可靠性等)。
以下是针对 Module 3: Analysis and Design Overview 的问题和答案的详细解答,包含中英文对照,确保清晰易懂:
1. What is the purpose of the Analysis and Design Discipline?
英文答案:
The purposes of Analysis and Design are to:
- Transform the requirements into a design of the system-to-be.
- Evolve a robust architecture for the system.
- Adapt the design to match the implementation environment, designing it for performance.
中文答案:
分析和设计的目的包括:
- 将需求转化为待建系统的设计。
- 为系统构建一个健壮的架构。
- 调整设计以适应实现环境,并针对性能进行设计。
2. Name and briefly describe the 4+1 Views of Architecture.
英文答案:
The 4+1 View Model is a framework for describing software architecture from multiple perspectives. It includes:
Logical View:
• Focuses on the functional requirements of the system.
• Describes the design of classes, their relationships, and interactions.
• Key artifact: Class diagrams.Process View:
• Focuses on the runtime behavior of the system, including concurrency and synchronization.
• Describes how objects interact dynamically.
• Key artifact: Sequence diagrams, activity diagrams.Physical View (Deployment View):
• Focuses on the physical deployment of the system, including hardware and software components.
• Describes how the system is distributed across nodes.
• Key artifact: Deployment diagrams.Development View:
• Focuses on the organization of the software in the development environment.
• Describes the structure of modules, packages, and files.
• Key artifact: Component diagrams.Use Case View (Scenarios):
• Focuses on the functional scenarios and user interactions with the system.
• Provides a narrative description of how the system is used.
• Key artifact: Use case diagrams, sequence diagrams.
中文答案:
4+1 视图模型 (4+1 View Model) 是一种从多个角度描述软件架构的框架。它包括以下视图:
逻辑视图 (Logical View):
• 关注系统的功能需求。
• 描述类的设计、类之间的关系及其交互。
• 主要工件:类图。过程视图 (Process View):
• 关注系统的运行时行为,包括并发性和同步性。
• 描述对象如何动态交互。
• 主要工件:序列图、活动图。物理视图(部署视图,Physical View/Deployment View):
• 关注系统的物理部署,包括硬件和软件组件。
• 描述系统如何在节点上分布。
• 主要工件:部署图。开发视图 (Development View):
• 关注软件开发环境中的软件组织。
• 描述模块、包和文件的结构。
• 主要工件:组件图。用例视图 (Use Case View):
• 关注功能场景和用户与系统的交互。
• 提供系统如何使用的叙述性描述。
• 主要工件:用例图、序列图。
3. What is the difference between Analysis and Design?
英文答案:
| Aspect | Analysis | Design |
| ———————————————— | ——————————————————————————— | —————————————————————————————— |
| Focus | Focus on understanding the problem. | Focus on understanding the solution. |
| Design Level | Idealized design (high-level). | Operations and attributes (detailed). |
| Behavior vs. Structure | Behavior (what the system does). | System structure (how the system is organized). |
| Functional vs. Nonfunctional | Functional requirements (what the system should do). | Nonfunctional requirements (performance, scalability, etc.). |
| Model Size | A small model that captures the essence of the system. | A large model that includes detailed design elements. |
中文答案:
| 方面 | 分析 (Analysis) | 设计 (Design) |
| ——————————————————————————— | —————————————— | ———————————————— |
| 关注点 (Focus) | 关注理解问题。 | 关注理解解决方案。 |
| 设计层次 (Design Level) | 理想化设计(高层次)。 | 操作和属性(详细设计)。 |
| 行为 vs. 结构 (Behavior vs. Structure) | 行为(系统做什么)。 | 系统结构(系统如何组织)。 |
| 功能性 vs. 非功能性 (Functional vs. Nonfunctional) | 功能需求(系统应该做什么)。 | 非功能需求(性能、可扩展性等)。 |
| 模型规模 (Model Size) | 捕获系统本质的小模型。 | 包含详细设计元素的大模型。 |
4. What is architecture?
英文答案:
Software architecture encompasses a set of significant decisions about the organization of a software system. These decisions include:
• The selection of structural elements and their interfaces by which the system is composed.
• The behavior of the structural elements as they interact.
• The composition of structural elements into larger subsystems.
• The architectural style that guides the organization of the system (e.g., layered, microservices).
• The allocation of responsibilities and constraints on the system’s design and evolution.
中文答案:
软件架构包括关于软件系统组织的一系列重要决策。这些决策包括:
• 系统的组成结构元素及其接口的选择。
• 结构元素之间的交互行为。
• 将结构元素组合成更大的子系统。
• 指导系统组织的架构风格(如分层架构、微服务架构)。
• 系统设计和演化的职责分配及约束条件。
总结表格
问题编号 | 英文问题 | 中文问题 | 答案 | 解释 (Explanation) |
---|---|---|---|---|
1 | What is the purpose of the Analysis and Design Discipline? | 分析和设计的目的有哪些? | 分析和设计的目的是将需求转化为系统设计,构建健壮的架构,并使设计适应实现环境。 | 分析和设计是软件开发中的关键阶段,连接需求与实现。 |
2 | Name and briefly describe the 4+1 Views of Architecture. | 列出并简要描述软件架构的 4+1 视图模型。 | 4+1 视图包括逻辑视图、过程视图、物理视图、开发视图和用例视图,分别从不同角度描述系统架构。 | 4+1 视图模型通过多个视角全面描述系统架构,适合复杂系统的设计。 |
3 | What is the difference between Analysis and Design? | 分析和设计有什么区别? | 分析关注问题理解,设计关注解决方案;分析是高层次的理想化设计,设计是详细的实现导向设计。 | 分析和设计是软件开发中的两个阶段,分析是理解需求,设计是构建解决方案。 |
4 | What is architecture? | 什么是软件架构? | 软件架构是关于软件系统组织的一系列重要决策,包括结构元素、行为、组合方式和架构风格等。 | 软件架构决定了系统的整体结构和设计原则,影响系统的开发、维护和演化。 |
复习建议
分析和设计的目的 (Purpose of Analysis and Design):
• 理解分析和设计的核心目标是将需求转化为系统设计,并构建健壮的架构。
• 分析关注问题,设计关注解决方案。4+1 视图模型 (4+1 View Model):
• 掌握 4+1 视图的五个视角及其用途。
• 理解每个视图的关注点和主要工件(如类图、序列图、部署图等)。分析和设计的区别 (Difference Between Analysis and Design):
• 分析是高层次的理想化设计,关注需求和功能。
• 设计是详细的实现导向设计,关注性能和非功能需求。软件架构 (Software Architecture):
• 理解软件架构的定义及其重要性。
• 掌握软件架构的关键决策内容,包括结构元素、行为、组合方式和架构风格。
以下是针对 Module 4: Architectural Analysis 的问题和答案的详细解答,包含中英文对照,确保清晰易懂:
1. What is a package?
英文答案:
A package is a general-purpose mechanism for organizing elements into groups. It is a model element that can contain other model elements.
Packages are used to:
• Group related model elements (e.g., classes, interfaces, use cases) together.
• Provide a namespace to avoid naming conflicts.
• Support modular design and improve the organization of large systems.
中文答案:
包是一种用于将元素分组组织的通用机制。它是一种模型元素,可以包含其他模型元素。
包的用途包括:
• 将相关的模型元素(如类、接口、用例等)分组在一起。
• 提供命名空间以避免命名冲突。
• 支持模块化设计,改善大型系统的组织结构。
2. What is a layered architecture? Give examples of typical layers.
- 应用子系统层 (Application Subsystems):
- 表示实现业务工作流的核心应用程序组件。
- 示例:订单管理、客户管理或库存管理。
- 业务特定层 (Business-Specific):
- 包含组织或领域特定的业务逻辑和规则。
- 示例:支付处理、税务计算或合规规则。
- 中间件层 (Middleware):
- 作为应用程序与底层基础设施之间的中介。
- 示例:消息队列、API 网关或通信协议。
- 系统软件层 (System Software):
- 提供系统运行所需的基础软件环境。
- 示例:操作系统、数据库管理系统或虚拟化层
以下是针对 Module 5: Use-Case Analysis 的问题和答案的详细解答,包含中英文对照,确保清晰易懂:
1. What is an analysis class? Name and describe the three analysis stereotypes.
英文答案:
An analysis class is a class identified during the analysis phase of a system. It represents a conceptual model of the system’s structure and behavior, focusing on the responsibilities and relationships of the system’s components rather than their implementation details.
The three analysis stereotypes are:
Boundary Class:
• Represents the interaction between the system and its external environment (e.g., users, other systems).
• Encapsulates the system’s interface and handles communication with external actors.
• Examples: User interfaces, APIs, or system entry points.Entity Class:
• Represents the core business entities or domain objects of the system.
• Encapsulates the data and behavior related to the system’s business logic.
• Examples: Customer, Order, Product.Control Class:
• Represents the logic that coordinates the interactions between boundary classes and entity classes.
• Encapsulates the flow of control and decision-making in the system.
• Examples: Controllers, workflow managers, or process handlers.
中文答案:
分析类 (Analysis Class) 是在系统分析阶段识别出的类。它表示系统的概念模型,关注系统组件的职责和关系,而不是其实现细节。
三种分析构造型 (Analysis Stereotypes) 包括:
边界类 (Boundary Class):
• 表示系统与外部环境(如用户、其他系统)之间的交互。
• 封装系统的接口并处理与外部参与者的通信。
• 示例:用户界面、API 或系统入口点。实体类 (Entity Class):
• 表示系统的核心业务实体或领域对象。
• 封装与系统业务逻辑相关的数据和行为。
• 示例:客户、订单、产品。控制类 (Control Class):
• 表示协调边界类和实体类之间交互的逻辑。
• 封装系统中的控制流和决策逻辑。
• 示例:控制器、工作流管理器或流程处理器。
2. What is a Use-Case Realization?
英文答案:
A Use-Case Realization is a design artifact that describes how a specific use case is implemented in the system. It provides traceability from the Analysis and Design phases back to the Requirements phase.
• Purpose:
• To ensure that the design aligns with the functional requirements captured in the use case.
• To document how the system will fulfill the responsibilities and behaviors described in the use case.
• Key Elements:
• Actors: External entities interacting with the system.
• Objects: Analysis or design classes (e.g., boundary, entity, control classes) involved in the use case.
• Interactions: Messages or operations exchanged between objects to achieve the use case’s goal.
中文答案:
用例实现 (Use-Case Realization) 是一种设计工件,描述了系统中如何实现特定的用例。它提供了从分析和设计阶段到需求阶段的可追溯性。
• 目的 (Purpose):
• 确保设计符合用例中捕获的功能需求。
• 记录系统如何履行用例中描述的责任和行为。
• 关键要素 (Key Elements):
• 参与者 (Actors): 与系统交互的外部实体。
• 对象 (Objects): 参与用例的分析类或设计类(如边界类、实体类、控制类)。
• 交互 (Interactions): 对象之间交换的消息或操作,以实现用例的目标。
3. How many Interaction diagrams should be produced during Use-Case Analysis?
英文答案:
During Use-Case Analysis, two interaction diagrams should typically be produced:
Collaboration Diagram (Communication Diagram):
• Focuses on the relationships and interactions between objects.
• Shows how objects are connected and how they collaborate to achieve the use case’s goal.Sequence Diagram:
• Focuses on the time sequence of messages exchanged between objects.
• Shows the order in which operations are invoked and completed.
Both diagrams provide complementary views of the system’s behavior during the execution of a use case.
中文答案:
在用例分析期间,通常应生成 两种交互图:
协作图(Collaboration Diagram,也称为通信图):
• 关注对象之间的关系和交互。
• 显示对象如何连接以及它们如何协作以实现用例的目标。序列图 (Sequence Diagram):
• 关注对象之间消息交换的时间顺序。
• 显示操作被调用和完成的顺序。
这两种图提供了用例执行期间系统行为的互补视图。
总结表格
问题编号 | 英文问题 | 中文问题 | 答案 | 解释 (Explanation) |
---|---|---|---|---|
1 | What is an analysis class? Name and describe the three analysis stereotypes. | 什么是分析类?列出并描述三种分析构造型。 | 分析类是系统分析阶段识别的类,表示系统的概念模型。三种分析构造型包括边界类、实体类和控制类。 | 边界类处理系统与外部的交互,实体类表示业务实体,控制类协调边界类和实体类的交互。 |
2 | What is a Use-Case Realization? | 什么是用例实现? | 用例实现是一种设计工件,描述系统中如何实现特定的用例,并提供从分析和设计到需求的可追溯性。 | 用例实现确保设计符合需求,并记录系统如何履行用例中的行为和责任。 |
3 | How many Interaction diagrams should be produced during Use-Case Analysis? | 在用例分析期间应生成多少种交互图? | 应生成两种交互图:协作图(通信图)和序列图。它们分别从对象关系和时间顺序的角度描述用例的行为。 | 协作图关注对象之间的关系,序列图关注消息的时间顺序,两者共同描述用例的执行过程。 |
复习建议
分析类 (Analysis Class):
• 理解分析类的作用是描述系统的概念模型,而不是实现细节。
• 掌握三种分析构造型(边界类、实体类、控制类)的职责和用途。用例实现 (Use-Case Realization):
• 理解用例实现的作用是连接需求、分析和设计。
• 确保设计符合用例的功能需求,并记录系统的行为。交互图 (Interaction Diagrams):
• 掌握协作图和序列图的用途和区别。
• 协作图关注对象关系,序列图关注时间顺序,两者共同描述用例的执行过程。
以下是针对 Module 6: Identify Design Elements 的问题和答案的详细解答,包含中英文对照,确保清晰易懂:
1. What is an interface?
英文答案:
An interface is a contract that defines the operations, methods, or services that a class, subsystem, or component provides to other parts of the system. It specifies what a component does but not how it does it.
Purpose:
To identify the interfaces of the subsystems based on their responsibilities.
中文答案:
接口 (Interface) 是一种契约,定义了类、子系统或组件向系统其他部分提供的操作、方法或服务。它指定了组件 做什么,但不指定 如何做。
目的 (Purpose):
基于子系统的职责,识别子系统的接口。
2. What is a subsystem? How does it differ from a package?
英文答案:
A subsystem is a modular unit of a system that encapsulates a set of related functionalities. It provides a clear and independent capability with well-defined interfaces, making it reusable and replaceable.
Differences between Subsystems and Packages:
Aspect | Subsystems | Packages |
---|---|---|
Purpose | Provide behavior and encapsulate functionality independently. | Organize and group related elements (e.g., classes, interfaces) without providing behavior. |
Encapsulation | Completely encapsulate their contents. | Do not completely encapsulate their contents. |
Reusability | Designed for potential reuse across systems or projects. | Not designed for reuse; primarily for organization. |
Replaceability | Easily replaced with alternative implementations. | May not be easily replaced. |
Behavior | Provide behavior and define clear interfaces. | Do not provide behavior. |
中文答案:
子系统 (Subsystem) 是系统的一个模块化单元,封装了一组相关的功能。它提供明确且独立的能力,并具有定义良好的接口,使其具有可重用性和可替换性。
子系统与包的区别 (Differences between Subsystems and Packages):
方面 | 子系统 (Subsystems) | 包 (Packages) |
---|---|---|
目的 (Purpose) | 提供行为并独立封装功能。 | 组织和分组相关元素(如类、接口),但不提供行为。 |
封装性 (Encapsulation) | 完全封装其内容。 | 不完全封装其内容。 |
可重用性 (Reusability) | 设计用于跨系统或项目的潜在重用。 | 不是为重用设计的,主要用于组织。 |
可替换性 (Replaceability) | 可以轻松替换为其他实现。 | 可能不容易替换。 |
行为 (Behavior) | 提供行为并定义清晰的接口。 | 不提供行为。 |
3. What is a subsystem used for, and how do you identify them?
英文答案:
Purpose of Subsystems:
• To partition the system into parts that can be independently developed, tested, deployed, and maintained.
• To encapsulate specific capabilities or functionalities of the system.
• To improve modularity, scalability, and maintainability.
How to Identify Subsystems:
• Look for high-level responsibilities or capabilities in the system.
• Identify groups of related classes, interfaces, or components that work together to fulfill a specific function.
• Consider independence and reusability: Can the group of elements function independently or be reused in another system?
• Evaluate interfaces: Does the group expose well-defined interfaces for interaction with other parts of the system?
中文答案:
子系统的用途 (Purpose of Subsystems):
• 将系统划分为可以独立开发、测试、部署和维护的部分。
• 封装系统的特定能力或功能。
• 提高模块化、可扩展性和可维护性。
如何识别子系统 (How to Identify Subsystems):
• 查找系统中具有 高层次职责 或 能力 的部分。
• 识别一组相关的 类、接口或组件,它们协同工作以实现特定功能。
• 考虑 独立性 和 可重用性:这组元素是否可以独立运行或在其他系统中重用?
• 评估 接口:这组元素是否暴露了清晰的接口以与其他系统部分交互?
4. What are some layering and partitioning considerations?
英文答案:
Layering Considerations:
- Visibility:
• Define which layers are visible to others and ensure that lower layers do not depend on higher layers. - Volatility:
• Place frequently changing components in more flexible layers to minimize the impact of changes. - Generality:
• General-purpose components should be placed in lower layers to allow reuse across multiple systems. - Number of Layers:
• Avoid too many layers, as this can increase complexity. Balance between granularity and simplicity.
Partitioning Considerations:
- Coupling and Cohesion:
• Minimize coupling (dependencies) between partitions and maximize cohesion (related responsibilities) within partitions. - User Organization:
• Partition based on user roles, responsibilities, or organizational structure. - Competency and/or Skill Areas:
• Assign partitions to teams or individuals based on their expertise or skill sets. - System Distribution:
• Consider how the system will be distributed across hardware or network environments. - Secrecy:
• Partition sensitive or confidential components separately to ensure security. - Variability:
• Partition components that are likely to change independently into separate modules.
中文答案:
分层考虑 (Layering Considerations):
- 可见性 (Visibility):
• 定义哪些层次对其他层次可见,并确保下层不依赖于上层。 - 易变性 (Volatility):
• 将频繁变化的组件放在更灵活的层次中,以减少变更的影响。 - 通用性 (Generality):
• 通用组件应放在较低的层次中,以便在多个系统中重用。 - 层数 (Number of Layers):
• 避免过多的层次,因为这会增加复杂性。在粒度和简单性之间找到平衡。
分区考虑 (Partitioning Considerations):
- 耦合性和内聚性 (Coupling and Cohesion):
• 最小化分区之间的耦合(依赖关系),并最大化分区内的内聚性(相关职责)。 - 用户组织 (User Organization):
• 根据用户角色、职责或组织结构进行分区。 - 能力和技能领域 (Competency and/or Skill Areas):
• 根据团队或个人的专业知识或技能分配分区。 - 系统分布 (System Distribution):
• 考虑系统如何在硬件或网络环境中分布。 - 保密性 (Secrecy):
• 将敏感或机密组件单独分区,以确保安全性。 - 可变性 (Variability):
• 将可能独立变化的组件分到不同的模块中。
总结表格
问题编号 | 英文问题 | 中文问题 | 答案 | 解释 (Explanation) |
---|---|---|---|---|
1 | What is an interface? | 什么是接口? | 接口是一种契约,定义了类、子系统或组件提供的操作、方法或服务。 | 接口指定了组件“做什么”,但不指定“如何做”,用于解耦和模块化设计。 |
2 | What is a subsystem? How does it differ from a package? | 什么是子系统?它与包有什么区别? | 子系统是系统的模块化单元,封装了独立的功能和行为;包是组织和分组相关元素,但不提供行为。 | 子系统具有独立性和可重用性,而包主要用于组织元素,不提供行为。 |
3 | What is a subsystem used for, and how do you identify them? | 子系统的用途是什么?如何识别子系统? | 子系统用于将系统划分为独立开发、测试和维护的部分;通过高层次职责、相关类和接口、独立性和接口来识别子系统。 | 子系统通过模块化和分层设计提高系统的可维护性和可扩展性。 |
4 | What are some layering and partitioning considerations? | 分层和分区有哪些考虑因素? | 分层考虑可见性、易变性、通用性和层数;分区考虑耦合性、用户组织、技能领域、系统分布、保密性和可变性。 | 分层和分区是系统设计中的重要原则,分层关注层次结构,分区关注模块划分,两者共同提高系统的模块化和灵活性。 |
复习建议
接口 (Interface):
• 理解接口的作用是定义组件的契约,明确“做什么”而不关心“如何做”。
• 接口用于解耦系统组件,提高系统的模块化和可维护性。子系统 (Subsystem):
• 子系统是系统的模块化单元,封装独立的功能和行为。
• 子系统具有独立性和可重用性,易于替换和扩展。分层和分区 (Layering and Partitioning):
• 分层关注系统的层次结构,确保下层不依赖上层,减少变更影响。
• 分区关注模块划分,最小化耦合性,最大化内聚性,并根据用户、技能和系统需求进行划分。
以下是针对 Module 7: Describe the Run-time Architecture 的问题和答案的详细解答,包含中英文对照,确保清晰易懂:
1. What is a process? What is a thread?
英文答案:
A process and a thread are fundamental concepts in concurrent and distributed systems:
Aspect | Process | Thread |
---|---|---|
Definition | A process is a heavyweight flow of control that provides a stand-alone execution environment. | A thread is a lightweight flow of control that runs within the context of a process. |
Resource Usage | A process has its own memory space and system resources. | Threads share the memory space and resources of the process they belong to. |
Independence | A process is independent and cannot directly access the memory or resources of another process. | Threads within the same process can share memory and resources. |
Creation Overhead | Creating a new process is resource-intensive and slower. | Creating a new thread is faster and less resource-intensive. |
Communication | Inter-process communication (IPC) is complex and slower. | Thread communication is faster because threads share the same memory space. |
中文答案:
进程 (Process) 和 线程 (Thread) 是并发和分布式系统中的基本概念:
方面 | 进程 (Process) | 线程 (Thread) |
---|---|---|
定义 (Definition) | 进程是一个重量级的控制流,提供独立的执行环境。 | 线程是一个轻量级的控制流,在进程的上下文中运行。 |
资源使用 (Resource Usage) | 每个进程都有独立的内存空间和系统资源。 | 线程共享其所属进程的内存空间和资源。 |
独立性 (Independence) | 进程是独立的,不能直接访问其他进程的内存或资源。 | 同一进程中的线程可以共享内存和资源。 |
创建开销 (Creation Overhead) | 创建新进程的资源开销较大且速度较慢。 | 创建新线程的速度更快,资源开销更小。 |
通信 (Communication) | 进程间通信(IPC)复杂且速度较慢。 | 线程间通信更快,因为线程共享同一内存空间。 |
2. Describe the two strategies for mapping classes and subsystems to processes.
英文答案:
There are two strategies for mapping classes and subsystems to processes, which are often used simultaneously:
1) Inside-Out Strategy:
• Focus: Start from the internal structure of the system and group elements based on their cooperation and execution requirements.
• Steps:
- Group elements that closely cooperate and must execute in the same thread of control.
- Separate elements that do not interact or have minimal interaction.
- Repeat the process until you reach the minimum number of processes that still provide the required distribution and effective resource utilization.
2) Outside-In Strategy:
• Focus: Start from the external interactions and stimuli to define the required processes and threads.
• Steps:
- Define a separate thread of control for each external stimulus (e.g., user input, network request).
- Define a separate server thread of control for each service provided by the system.
- Reduce the number of threads to the minimum number that the system can support efficiently.
中文答案:
将类和子系统映射到进程的两种策略通常是同时使用的:
1) 内部驱动策略 (Inside-Out Strategy):
• 重点: 从系统的内部结构出发,根据元素的协作关系和执行需求进行分组。
• 步骤:
- 将紧密协作且必须在同一控制线程中执行的元素分组。
- 将不交互或交互较少的元素分开。
- 重复上述过程,直到达到满足分布需求和资源利用率的最小进程数。
2) 外部驱动策略 (Outside-In Strategy):
• 重点: 从外部交互和刺激出发,定义所需的进程和线程。
• 步骤:
- 为每个外部刺激(如用户输入、网络请求)定义一个独立的控制线程。
- 为系统提供的每项服务定义一个独立的服务线程。
- 将线程数减少到系统能够高效支持的最小数量。
3. How do you model the Process View? What modeling elements and diagrams are used?
英文答案:
The Process View models the runtime behavior of the system, focusing on processes, threads, and their interactions. It can be modeled using the following elements and diagrams:
Modeling Elements:
Active Classes (Class Diagrams):
• Represent processes or threads as active classes.
• Active classes have their own thread of control and can initiate actions independently.Objects (Interaction Diagrams):
• Represent instances of active classes or other objects that participate in the runtime behavior.Components (Component Diagrams):
• Represent the physical or logical components of the system that are deployed and executed as part of the process.
Diagrams Used:
Class Diagrams:
• Use active classes to model processes or threads.
• Show relationships between active classes and other system components.Sequence Diagrams:
• Model the interactions between processes, threads, and objects over time.Activity Diagrams:
• Represent the flow of activities within a process or thread.Component Diagrams:
• Show the deployment and interaction of components across processes.
中文答案:
进程视图 (Process View) 模型描述了系统的运行时行为,重点关注进程、线程及其交互。可以使用以下建模元素和图来建模进程视图:
建模元素 (Modeling Elements):
活动类 (Active Classes):
• 在类图中将进程或线程表示为活动类。
• 活动类具有独立的控制线程,可以独立启动操作。对象 (Objects):
• 表示活动类或其他参与运行时行为的对象的实例。组件 (Components):
• 表示系统中的物理或逻辑组件,这些组件作为进程的一部分被部署和执行。
使用的图 (Diagrams Used):
类图 (Class Diagrams):
• 使用活动类建模进程或线程。
• 显示活动类与其他系统组件之间的关系。序列图 (Sequence Diagrams):
• 模拟进程、线程和对象之间的交互随时间的变化。活动图 (Activity Diagrams):
• 表示进程或线程内的活动流。组件图 (Component Diagrams):
• 显示组件在进程中的部署和交互。
总结表格
问题编号 | 英文问题 | 中文问题 | 答案 | 解释 (Explanation) |
---|---|---|---|---|
1 | What is a process? What is a thread? | 什么是进程?什么是线程? | 进程是重量级的控制流,提供独立的执行环境;线程是轻量级的控制流,在进程上下文中运行。 | 进程具有独立的内存空间,线程共享进程的内存空间。进程创建开销大,线程创建开销小。 |
2 | Describe the two strategies for mapping classes and subsystems to processes. | 描述将类和子系统映射到进程的两种策略。 | 内部驱动策略(Inside-Out)从内部结构出发分组元素;外部驱动策略(Outside-In)从外部交互出发定义线程和服务。 | 内部驱动策略关注协作关系,外部驱动策略关注外部刺激,两者结合可实现高效的进程和线程映射。 |
3 | How do you model the Process View? What modeling elements and diagrams are used? | 如何建模进程视图?使用哪些建模元素和图? | 使用活动类、对象和组件建模;使用类图、序列图、活动图和组件图表示进程视图。 | 进程视图通过活动类表示进程和线程,通过交互图表示线程和对象的交互,通过组件图表示部署和交互关系。 |
复习建议
进程与线程 (Process vs. Thread):
• 理解进程是独立的执行环境,具有独立的内存空间;线程是轻量级的控制流,共享进程的内存空间。
• 掌握进程创建开销大、线程创建开销小的特点。映射策略 (Mapping Strategies):
• 内部驱动策略(Inside-Out)关注系统内部协作关系,外部驱动策略(Outside-In)关注外部交互和刺激。
• 两种策略结合使用,可以实现高效的进程和线程映射。进程视图建模 (Process View Modeling):
• 使用活动类、对象和组件表示进程和线程。
• 使用类图、序列图、活动图和组件图描述进程视图的运行时行为。
以下是针对 Module 8: Describe Distribution 的问题和答案的详细解答,包含中英文对照,确保清晰易懂:
1. What is a node? Describe the two different “types” of nodes.
英文答案:
A node is a physical runtime computational resource that supports the execution of software components in a distributed system.
Two Types of Nodes:
Processor Node:
• Executes system software, such as applications, services, or middleware.
• Examples: Servers, personal computers, or embedded systems with processing capabilities.Device Node:
• Represents a physical device that supports specific hardware functionality.
• Typically controlled by a processor node.
• Examples: Printers, sensors, cameras, or IoT devices.
中文答案:
节点 (Node) 是分布式系统中支持软件组件运行的物理运行时计算资源。
两种类型的节点 (Two Types of Nodes):
处理器节点 (Processor Node):
• 执行系统软件,例如应用程序、服务或中间件。
• 示例:服务器、个人计算机或具有处理能力的嵌入式系统。设备节点 (Device Node):
• 表示支持特定硬件功能的物理设备。
• 通常由处理器节点控制。
• 示例:打印机、传感器、摄像头或物联网设备。
2. Describe some of the considerations when mapping processes to nodes.
英文答案:
When mapping processes to nodes, the following considerations are important:
Process-to-Node Allocation Considerations:
Distribution Patterns:
• Decide whether processes should be distributed across multiple nodes or centralized on a single node.
• Consider factors like fault tolerance, scalability, and performance.Response Time and System Throughput:
• Ensure that the distribution of processes minimizes response time and maximizes system throughput.
• Avoid bottlenecks by balancing the workload across nodes.Minimization of Cross-Network Traffic:
• Reduce communication between nodes to minimize network traffic and latency.
• Place tightly coupled processes on the same node if possible.Node Capacity:
• Ensure that the selected node has sufficient computational, memory, and storage resources to handle the assigned processes.Communication Medium Bandwidth:
• Consider the bandwidth of the communication medium when placing processes on different nodes.
• High-bandwidth requirements may require faster communication links.Availability of Hardware and Communication Links:
• Ensure that the required hardware and communication links are available and reliable.Rerouting Requirements:
• Plan for failover and redundancy by considering how processes can be rerouted in case of node or link failure.
中文答案:
在将进程映射到节点时,需要考虑以下因素:
进程到节点分配的考虑因素 (Process-to-Node Allocation Considerations):
分布模式 (Distribution Patterns):
• 决定进程是分布在多个节点上还是集中在单个节点上。
• 考虑容错性、可扩展性和性能等因素。响应时间和系统吞吐量 (Response Time and System Throughput):
• 确保进程分布能够最小化响应时间并最大化系统吞吐量。
• 通过平衡节点间的工作负载避免瓶颈。最小化跨网络流量 (Minimization of Cross-Network Traffic):
• 减少节点间的通信以降低网络流量和延迟。
• 尽可能将紧密耦合的进程放在同一个节点上。节点容量 (Node Capacity):
• 确保所选节点具有足够的计算、内存和存储资源来处理分配的进程。通信介质带宽 (Communication Medium Bandwidth):
• 在将进程分布到不同节点时,考虑通信介质的带宽。
• 高带宽需求可能需要更快的通信链路。硬件和通信链路的可用性 (Availability of Hardware and Communication Links):
• 确保所需的硬件和通信链路可用且可靠。重路由需求 (Rerouting Requirements):
• 考虑节点或链路故障时的故障转移和冗余,规划进程如何重新路由。
3. How do you model the Deployment View? What modeling elements and diagrams are used?
英文答案:
The Deployment View models the physical deployment of software components on hardware nodes in a distributed system. It describes how processes and threads are mapped to nodes and how nodes are interconnected.
Modeling Elements:
Nodes:
• Represent physical or logical computational resources (e.g., servers, devices).
• Can be classified as Processor Nodes or Device Nodes.Connections:
• Represent the communication mechanisms between nodes.
• Include physical media (e.g., cables) and software protocols (e.g., HTTP, TCP/IP).
Diagrams Used:
Deployment Diagrams:
• Show the relationships between nodes and the placement of components on nodes.
• Represent connections between nodes to illustrate communication paths.Component Diagrams (Optional):
• Can be used to show the relationship between software components and the nodes they are deployed on.
中文答案:
部署视图 (Deployment View) 模型描述了分布式系统中软件组件在硬件节点上的物理部署方式。它描述了进程和线程如何映射到节点,以及节点如何互连。
建模元素 (Modeling Elements):
节点 (Nodes):
• 表示物理或逻辑的计算资源(如服务器、设备)。
• 可分为 处理器节点 (Processor Nodes) 和 设备节点 (Device Nodes)。连接 (Connections):
• 表示节点之间的通信机制。
• 包括物理介质(如电缆)和软件协议(如 HTTP、TCP/IP)。
使用的图 (Diagrams Used):
部署图 (Deployment Diagrams):
• 显示节点之间的关系以及组件在节点上的部署位置。
• 表示节点之间的连接以说明通信路径。组件图 (Component Diagrams) [可选]:
• 可用于显示软件组件与部署它们的节点之间的关系。
总结表格
问题编号 | 英文问题 | 中文问题 | 答案 | 解释 (Explanation) |
---|---|---|---|---|
1 | What is a node? Describe the two different “types” of nodes. | 什么是节点?描述两种不同类型的节点。 | 节点是分布式系统中的物理计算资源。分为处理器节点(执行系统软件)和设备节点(支持硬件功能)。 | 处理器节点如服务器、PC,设备节点如打印机、传感器,通常由处理器节点控制。 |
2 | Describe some of the considerations when mapping processes to nodes. | 描述将进程映射到节点时的一些考虑因素。 | 包括分布模式、响应时间和吞吐量、跨网络流量最小化、节点容量、通信带宽、硬件可用性和重路由需求。 | 进程映射到节点需要综合考虑性能、负载均衡、通信开销和容错性等因素。 |
3 | How do you model the Deployment View? What modeling elements and diagrams are used? | 如何建模部署视图?使用哪些建模元素和图? | 使用节点和连接作为建模元素,部署图用于表示节点关系和组件部署,组件图可选用于显示组件与节点的关系。 | 部署视图通过部署图描述软件组件在硬件节点上的物理部署,连接表示节点间的通信机制。 |
复习建议
节点 (Node):
• 理解节点是分布式系统中的物理计算资源,分为处理器节点和设备节点。
• 处理器节点执行系统软件,设备节点支持硬件功能,通常由处理器节点控制。进程到节点的映射 (Process-to-Node Mapping):
• 考虑分布模式、响应时间、吞吐量、跨网络流量、节点容量、通信带宽、硬件可用性和重路由需求。
• 目标是优化性能、负载均衡和容错性。部署视图建模 (Deployment View Modeling):
• 使用部署图表示节点关系和组件部署。
• 使用连接表示节点间的通信机制,确保设计满足性能和可靠性需求。
通过针对性练习这些问题,可以快速巩固分布式系统设计的核心概念!
以下是针对 Module 9: Use-Case Design 的问题和答案的详细解答,包含中英文对照,确保清晰易懂:
1. What is meant by encapsulating subsystem interactions? Why is it a good thing to do?
英文答案:
Encapsulating subsystem interactions means defining and isolating the interactions between subsystems in a way that hides their internal details and exposes only the necessary interfaces. This is achieved by describing the interactions at a higher level of abstraction, often using interaction diagrams specific to the subsystems.
Advantages of Encapsulating Subsystem Interactions:
Simplified Use-Case Realizations:
• Use-case realizations become less cluttered because the internal details of subsystems are hidden.
• Only the interactions relevant to the use case are visible, making the design easier to understand and maintain.Parallel Development:
• Subsystem interactions can be designed and modeled independently of the internal details of the subsystems.
• This allows teams to work on different subsystems simultaneously, enabling parallel development.Flexibility and Reusability:
• Encapsulated interactions make the use-case realizations more generic and easier to modify.
• Subsystems can be substituted or replaced without affecting the overall system design, as long as the interfaces remain consistent.Improved Maintainability:
• Changes to the internal design of a subsystem do not propagate to other subsystems or the overall system design.
• This reduces the risk of introducing errors during maintenance or updates.
中文答案:
封装子系统交互 (Encapsulating Subsystem Interactions) 是指以一种隐藏子系统内部细节并仅暴露必要接口的方式定义和隔离子系统之间的交互。这通常通过使用特定于子系统的交互图在更高的抽象层次上描述交互来实现。
封装子系统交互的优点 (Advantages of Encapsulating Subsystem Interactions):
简化的用例实现 (Simplified Use-Case Realizations):
• 用例实现变得更加简洁,因为子系统的内部细节被隐藏。
• 只有与用例相关的交互是可见的,这使得设计更易于理解和维护。并行开发 (Parallel Development):
• 子系统交互可以独立于子系统的内部细节进行设计和建模。
• 这允许多个团队同时处理不同的子系统,从而实现并行开发。灵活性和可重用性 (Flexibility and Reusability):
• 封装的交互使用例实现更加通用,更容易修改。
• 只要保持接口一致,子系统可以被替换或更换,而不会影响整体系统设计。提高可维护性 (Improved Maintainability):
• 子系统的内部设计变更不会传播到其他子系统或整体系统设计。
• 这降低了在维护或更新过程中引入错误的风险。
总结表格
问题编号 | 英文问题 | 中文问题 | 答案 | 解释 (Explanation) |
---|---|---|---|---|
1 | What is meant by encapsulating subsystem interactions? Why is it a good thing to do? | 什么是封装子系统交互?为什么这是一个好事情? | 封装子系统交互是指隐藏子系统内部细节并仅暴露必要接口的过程,通过高层次的交互图描述子系统间的交互。封装的优点包括简化用例实现、支持并行开发、提高灵活性和可重用性,以及增强可维护性。 | 封装子系统交互通过隐藏内部细节,减少了设计的复杂性,支持团队并行工作,并使系统更易于维护和扩展。封装还提高了系统的灵活性,允许子系统被替换而不影响整体设计。 |
复习建议
封装子系统交互 (Encapsulating Subsystem Interactions):
• 理解封装的目的是隐藏子系统的内部细节,仅暴露必要的接口。
• 封装通过高层次的交互图描述子系统间的交互,简化了用例实现。封装的优点:
• 简化用例实现: 隐藏子系统细节,使设计更清晰。
• 并行开发: 子系统可以独立设计和开发,支持团队协作。
• 灵活性和可重用性: 子系统可以替换或更换,而不会影响整体设计。
• 提高可维护性: 子系统的内部变更不会传播到其他部分,降低维护风险。
以下是针对 Module 10: Subsystem Design 和 Module 11: Class Design 的问题和答案的详细解答,包含中英文对照,确保清晰易懂:
Module 10: Subsystem Design
1. How many interaction diagrams should be produced during Subsystem Design?
英文答案:
During Subsystem Design, one or more interaction diagrams should be produced for each interface operation.
• Each interaction diagram represents a specific flow of events or scenarios related to the interface operation.
• The number of diagrams depends on the complexity of the interface and the different scenarios it supports.
中文答案:
在子系统设计期间,每个接口操作应生成 一个或多个交互图。
• 每个交互图表示与接口操作相关的特定事件流或场景。
• 图的数量取决于接口的复杂性以及它支持的不同场景。
Module 11: Class Design
1. Are statecharts created for every class?
英文答案:
No, statecharts are not created for every class.
• A statechart is a directed graph of states (nodes) connected by transitions (directed arcs).
• Statecharts are created only for classes that exhibit state-controlled behavior, where the behavior of the class depends on its current state.
中文答案:
不,并不是每个类都需要创建状态图。
• 状态图 (Statechart) 是一个由状态(节点)通过转换(有向弧)连接的有向图。
• 状态图仅用于具有 状态控制行为 的类,即类的行为取决于其当前状态。
2. What are the major components of a statechart? Provide a brief description of each.
英文答案:
The major components of a statechart include:
Significant, Dynamic Attributes:
• Attributes that define the state of the object and may change during its lifecycle.Existence and Non-Existence of Certain Links:
• Represents relationships between objects that may exist or disappear depending on the state.Events:
• Triggers that cause transitions between states.
• Examples: User actions, system events, or external stimuli.Transitions:
• Represent the movement from one state to another in response to an event.
• Transitions are triggered by events and may have guards (conditions) and actions.Activities and Actions:
• Activities: Ongoing processes that occur within a state (e.g., a timer running).
• Actions: Specific operations executed during a transition or while in a state.
中文答案:
状态图的主要组成部分包括:
重要的动态属性 (Significant, Dynamic Attributes):
• 定义对象状态的属性,这些属性在对象的生命周期中可能会发生变化。某些链接的存在与否 (Existence and Non-Existence of Certain Links):
• 表示对象之间的关系可能会根据状态的存在或消失而变化。事件 (Events):
• 触发状态之间转换的事件。
• 示例:用户操作、系统事件或外部刺激。转换 (Transitions):
• 表示对象从一个状态响应事件转移到另一个状态的过程。
• 转换由事件触发,可能包含条件(guards)和动作(actions)。活动和动作 (Activities and Actions):
• 活动 (Activities): 在某个状态下持续进行的过程(例如,计时器运行)。
• 动作 (Actions): 在转换期间或处于某个状态时执行的具体操作。
3. What is the difference between an association and a dependency?
英文答案:
| Aspect | Association | Dependency |
| ——————— | —————————————————————————————— | —————————————————————————————— |
| Definition | A structural relationship between two classes that indicates a long-term connection. | A nonstructural relationship that indicates a temporary dependency between objects. |
| Nature | Structural (static relationship between classes). | Nonstructural (dynamic relationship between objects). |
| Visibility | Links created by associations are visible in the system’s structure. | Dependencies do not create permanent links and are context-dependent. |
| Duration | Associations are long-term and persistent. | Dependencies are transient and short-lived. |
| Example | A “Student” is associated with a “Course” (structural relationship). | A “Method” depends on another “Class” to perform its functionality (temporary). |
中文答案:
| 方面 | 关联 (Association) | 依赖 (Dependency) |
| ———————————- | ———————————————————— | ——————————————————————— |
| 定义 (Definition) | 类之间的结构关系,表示长期的连接。 | 对象之间的非结构关系,表示临时的依赖。 |
| 性质 (Nature) | 结构性(类之间的静态关系)。 | 非结构性(对象之间的动态关系)。 |
| 可见性 (Visibility) | 由关联创建的链接在系统结构中是可见的。 | 依赖不会创建永久链接,而是依赖于上下文。 |
| 持续时间 (Duration) | 关联是长期的、持久的。 | 依赖是短暂的、瞬时的。 |
| 示例 (Example) | “学生”与“课程”之间的关联(结构性关系)。 | “方法”依赖于另一个“类”以执行其功能(临时性)。 |
总结表格
模块 | 问题编号 | 英文问题 | 中文问题 | 答案 | 解释 (Explanation) |
---|---|---|---|---|---|
Module 10 | 1 | How many interaction diagrams should be produced during Subsystem Design? | 在子系统设计期间应生成多少个交互图? | 每个接口操作应生成一个或多个交互图,具体数量取决于接口的复杂性和支持的场景。 | 交互图用于描述接口操作的事件流,复杂接口可能需要多个交互图来表示不同的场景。 |
Module 11 | 1 | Are statecharts created for every class? | 是否为每个类都创建状态图? | 不是,状态图仅用于具有状态控制行为的类,即类的行为取决于其当前状态。 | 状态图用于建模对象的状态变化,只有状态相关的类才需要状态图。 |
Module 11 | 2 | What are the major components of a statechart? Provide a brief description of each. | 状态图的主要组成部分是什么?请简要描述每个部分。 | 状态图包括动态属性、链接的存在与否、事件、转换、活动和动作。这些部分共同描述了对象的状态变化和行为。 | 动态属性定义对象状态,事件触发转换,转换表示状态变化,活动和动作描述状态内的行为或转换时的操作。 |
Module 11 | 3 | What is the difference between an association and a dependency? | 关联和依赖之间的区别是什么? | 关联是类之间的结构性关系,表示长期连接;依赖是非结构性关系,表示临时依赖。关联可见且持久,依赖短暂且上下文相关。 | 关联用于描述类之间的静态关系,依赖用于描述对象之间的动态关系。关联是持久的,依赖是短暂的,依赖通常通过方法调用实现。 |
复习建议
子系统设计中的交互图 (Interaction Diagrams in Subsystem Design):
• 每个接口操作可能需要一个或多个交互图,具体数量取决于接口的复杂性和支持的场景。
• 交互图用于描述接口操作的事件流,帮助清晰地定义子系统的行为。状态图 (Statechart):
• 状态图仅用于具有状态控制行为的类,描述对象的状态变化和触发状态转换的事件。
• 状态图的核心组成部分包括动态属性、事件、转换、活动和动作。关联与依赖的区别 (Association vs. Dependency):
• 关联 (Association): 类之间的结构性关系,表示长期连接,可见且持久。
• 依赖 (Dependency): 对象之间的非结构性关系,表示临时依赖,短暂且上下文相关。