软件系统设计期末复习清单
考试形式:英文卷面,中文作答。复习目标不是只背概念,而是做到:看到英文题干能识别考点,中文能写出结构化答案,设计题能画图并说明模式/架构决策。
优先级规则
- P0 必背:整理成可直接默写的中文答题模板
- P1 必会:重点练解释、画图、应用和案例分析
- P2 概念:能识别英文术语并说出核心含义
- 提示:加分句、易错点或设计理由
一、设计模式必背概念与原则
1. OO 设计原则
- SRP:一个类只有一个引起变化的原因
- OCP:对扩展开放,对修改关闭
- LSP:子类对象可以替换父类对象且行为不变
- ISP:胖接口拆成更小、更具体的接口
- DIP:面向接口编程,不面向实现编程
- CRP/CARP:优先使用组合而不是继承
- LoD/LKP:只与最直接的朋友交流
- EVP:封装变化
高频题干:
Please explain the Liskov Substitution Principle and how it contributes to the Open-Closed Principle.
Please name at least three Object-Oriented principles, and explain how they are applied in Strategy pattern.
对应往年题:
- 2017:Please name at least three Object-Oriented principles, and explain how they are applied in Strategy pattern.
- 2021:依赖倒转原则是什么?如何反映在设计模式中?
- 2022:Please explain the Liskov Substitution Principle and how it contributes to the Open-Closed Principle.
- 2025:一个 notifier 和继承的 emailNotifier,问是否满足 OOP 原则,解释。
2. 设计模式基础
- 会定义 design pattern
- 背四要素:pattern name、problem、solution、consequences
- 会区分 creational、structural、behavioral
- 会区分类模式和对象模式
- 会解释 rule of three
- 会说明选择模式时 constraints 必须考虑
对应往年题:
- 2019:设计模式是什么?举例说明类模式和对象模式的区别。
- 2021:软件模式是什么?能提供架构吗?
二、设计模式各模式复习清单
1. 创建型模式
- Simple Factory:为什么新增产品会修改工厂,违背 OCP
- Factory Method:如何通过抽象工厂和具体工厂符合 OCP
- Abstract Factory:product hierarchy、product family
- Abstract Factory:容易增加产品族,难以增加新的产品等级结构
- Builder:相同构建过程创建不同表示
- Builder:Director 分离 client 和 production
- Prototype:通过复制原型创建对象
- Prototype:shallow clone、deep clone
- Prototype vs Flyweight:为什么一个是创建型,一个是结构型
高频题干:
Please explain how the Factory Method Pattern and Abstract Factory Pattern adhere to the Open-Closed Principle.
What categories do Prototype and Flyweight fall into, respectively? Explain why.
对应往年题:
- 2021:享元模式和原型模式为什么在不同的分类?
- 2022:Please explain how the Factory Method Pattern and Abstract Factory Pattern adhere to the Open-Closed Principle.
- 2022:What is the difference between the categories of Creational Patterns and Structural Patterns? What categories do Prototype and Flyweight fall into, respectively? Explain why.
- 2025:工厂方法和抽象工厂属于什么类型,怎么体现 OCP。
2. 结构型模式
- Adapter:class adapter vs object adapter
- Adapter:default adapter、bidirectional adapter
- Composite:整体-部分树形结构,叶子和容器一致处理
- Composite:透明组合 vs 安全组合
- Bridge:两个正交变化维度,抽象与实现分离
- Bridge vs Adapter:早期设计 vs 后期适配
- Decorator:动态增加/撤销功能,接口保持一致
- Decorator:缺点是小对象多、排错困难
- Facade:高层统一入口,体现 LoD
- Flyweight:内部状态、外部状态、享元池
- Proxy:控制访问,remote / virtual / protection / cache 等类型
- Facade vs Proxy:简化子系统访问 vs 控制单个对象访问
高频题干:
What principle does Facade satisfy?
What is the difference between Facade and Proxy? Give examples.
对应往年题:
- 2019:最小知识原则在设计模式中的应用。
- 2021:大学由若干个系组成,学生和老师属于某个系,形成树状结构;给部门或个人发送通知,用什么设计模式?画类图。
- 2022:OA 系统保存部门和人员树形结构,通知部门所有人或部分个人,画类图并写代码。
- 2025:外观满足的原则,外观和代理的区别并举例。
3. 行为型模式
- Strategy:封装变化,算法族可互换
- Strategy:Context 持有 Strategy,客户端要知道不同策略
- State:状态改变导致行为改变,状态转换封装到状态类
- Strategy vs State:策略由外部设置,状态通常内部转换
- Command:Invoker、Command、ConcreteCommand、Receiver、Client
- Command:解耦 Invoker 和 Receiver
- Command:支持 queue、macro command、undo/redo
- Observer:Subject、Observer,一对多依赖
- Observer:push model vs pull model
- Observer:change manager、MVC
- Mediator:用中介者封装对象交互,体现 LoD
- Template Method:primitive method、template method、hook method
- Template Method:Hollywood Principle
高频题干:
What is the benefit of decoupling the Receiver from the Invoker in the Command Pattern?
Why would push model or pull model be preferable in Observer Pattern?
What are the main roles of Command Pattern? Can the Invoker be removed?
对应往年题:
- 2018:飞行模拟软件,要求能模拟多种飞机特性,为将来支持更多飞机种类,使用策略模式,画架构图和类图。
- 2019:买票系统,不同角色有不同折扣方案,用策略模式设计,画图并说明策略模式使用场景。
- 2019:策略模式和状态模式的区别。
- 2021:命令模式的适用环境是什么?
- 2021:什么是组合命令/宏命令?写出大概的组合命令类代码。
- 2022:What is the benefit of decoupling the Receiver from the Invoker in the Command Pattern?
- 2022:Observer design pattern 的 push model 和 pull model,为什么选择其中一个?各自 trade-offs 是什么?
- 2025:命令模式的主要角色,其中调用者是否能去掉。
- 2025:Java 内置的 notifyObserver 为什么有两种重载版本。
三、设计题专项
1. 必练类图
- Strategy 类图
- Command 类图
- Observer 类图
- Composite 类图
- Adapter 类图
- Decorator 类图
- Facade 类图
- Proxy 类图
- Factory Method 类图
- Abstract Factory 类图
对应往年题:
- 2018:飞行模拟软件,使用策略模式,画架构图和类图。
- 2019:买票系统,使用策略模式,画图并说明适用场景。
- 2021:大学部门-人员树形结构通知系统,判断模式并画类图。
- 2022:OA 通知系统,画设计类图并写代码。
2. 必练 UML 关系
- 泛化 generalization:实线空心三角
- 实现 realization:虚线空心三角
- 聚合 aggregation:空心菱形
- 组合 composition:实心菱形
- 关联 association
- 依赖 dependency
对应往年题:
- 设计题普遍要求画类图;UML 箭头画错会影响模式结构表达,尤其是继承/实现、组合/聚合、关联/依赖。
3. 往年设计题类型
- 大学/OA 部门树通知系统:Composite + Observer
- 多通知渠道通知系统:Observer + Strategy/Decorator/Command,注意运行时条件和避免无用信息
- 飞行模拟软件:Strategy
- 买票折扣系统:Strategy
- 游戏角色 + 武器 + 非人类角色 + 死亡通知:Strategy + Adapter + Observer
- 宏命令:Composite Command
- 多例模式 Multi-instance:限制实例数不超过 n,写代码
- 管道-过滤器:输入文本文件,输出排序去重单词列表
- 分布式缓存更新:Observer / Publish-Subscribe + connector/web services + sequence diagram
- 外卖平台微服务拆分:系统操作、微服务、服务关系
对应往年题:
- 2015:设计题据回忆与 2019 题类似。
- 2018:飞行模拟软件,策略模式。
- 2019:游戏角色、武器、非人类角色适配、死亡通知。
- 2019:买票系统折扣策略。
- 2021:组合通知系统、宏命令、管道-过滤器。
- 2022:Multi-instance;OA 通知系统;分布式缓存更新。
- 2025:多渠道通知系统;外卖平台微服务拆分。
四、代码题与小程序题
- 会写 Singleton / Multi-instance 代码
- 会写 MacroCommand 代码
- 会写 Observer 注册、删除、通知代码
- 会写 Strategy 基本代码
- 会写 Composite 树形递归代码
- 会写 Pipe-and-Filter 基本类结构
- 能说明代码和类图/架构图之间的映射
对应往年题:
- 2021:宏命令类代码。
- 2021:Pipe-and-Filter 程序要求组件图、类图、Java 实现,并指出代码和图的映射。
- 2022:Multi-instance pattern,要求写代码实现实例数不超过常数 n。
- 2022:OA 通知系统,要求画类图并写代码。
五、最高优先级:架构必考区
1. 质量属性场景 Modeling QA Scenarios
- 背出六要素:source of stimulus、stimulus、artifact、environment、response、response measure
- 会解释 general scenario 和 concrete scenario 的区别
- 会画 stimulus-response 格式图
- 会写 availability 场景
- 会写 performance 场景
- 会写 modifiability 场景
- 会写 interoperability 场景
- 会解释 response measure 为什么使需求可测试
高频题干:
How to model quality attribute scenarios?
Graphically model two quality attributes in "stimulus-response" format.
对应往年题:
- 2015:How to model quality attribute scenarios? Graphically model two quality attributes in “stimulus-response” format: availability and performance.
- 2017:Graphically model availability and modifiability.
- 2018:Graphically model availability and modifiability.
- 2019:Graphically model interoperability and modifiability.
- 2025:如何描述质量属性场景,描述可操作性和性能的质量属性场景。
2. ASR 与需求
- 背 ASR 定义:Architecturally Significant Requirements
- 会区分 software requirements、quality attributes、ASRs
- 会解释 functional requirements、quality requirements、constraints
- 会写 constraints:zero degrees of freedom 的设计决策
- 背 ASR 四种来源/识别方法:
- requirement documents
- QA Workshop / interviews
- business goals
- utility tree
高频题干:
What are ASRs?
List four sources and methods for extracting and identifying ASRs.
Describe the difference and relationship between software requirements, quality attributes, and ASRs.
对应往年题:
- 2017:What are ASR? List four sources and methods for extracting and identifying ASRs.
- 2018:Software requirements, quality attributes, ASRs 的区别和联系。
- 2019:What are ASR? List four sources and methods for extracting and identifying ASRs.
- 2025:什么需求影响架构,怎么得到。
3. Views and Beyond / 多视图文档化
- 会解释为什么架构要用不同视图文档化
- 背三大 structural views:
- module views
- component-and-connector views
- allocation views
- 每类至少背 4 个 view
- 会解释 quality views
- 背 Information Beyond Views:
- documentation roadmap
- how a view is documented
- system overview
- mapping between views
- rationale
- directory / glossary / index
高频题干:
Why should a software architecture be documented using different views?
Give the name and purposes of four example views.
What should be included in a typical software architecture documentation package?
对应往年题:
- 2015:Why should a software architecture be documented using different views? Give the name and purposes of 4 example views.
- 2017:What should be included in a typical software architecture documentation package? Briefly describe each component and its purpose.
- 2019:What should be included in a typical software architecture documentation package?
4. 4+1 View Model
- 背 logical view
- 背 process view
- 背 physical view
- 背 development view
- 背 architecture use cases / scenarios
- 能画 4+1 简图
对应往年题:
- 2017:Describe 4+1 view.
- 2019:4+1 视图介绍,还要画图。
5. Architecture Styles / Views 连线题
- Module Styles 回答:how it is structured as implementation units
- C&C Styles 回答:runtime behavior and interactions
- Allocation Styles 回答:relationship to non-software environment
- Module views:decomposition、uses、generalization、layered、domain、data model
- C&C views:pipe-and-filter、client-server、peer-to-peer、SOA、publish-subscribe、shared-data
- Allocation views:deployment、installation、work assignment、other allocation views
高频题干:
Map each question with the architectural style/view.
List four views of each category of style.
对应往年题:
- 2015:Mapping, and list 4 views for each style.
- 2017:Map, and list four views of each category of style.
- 2018:连线,并对每种 style 列出四种视图。
- 2019:Map, and list four views of each category of style.
6. ATAM
- 背 ATAM 每个阶段输出
- 会写整体输出:
- concise architecture presentation
- business goals
- prioritized QA scenarios
- utility tree
- risks and non-risks
- risk themes
- sensitivity points and trade-off points
- final evaluation report
- 会写各阶段 stakeholders 和职责
- 会解释 risks、sensitivity points、trade-off points,并各举例
高频题干:
Describe outputs generated from each phase of ATAM process.
What are risks, sensitivity points, and trade-off points? Give an example for each.
对应往年题:
- 2015:Describe outputs generated from each phase of ATAM process.
- 2017:Describe outputs generated from each phase of ATAM process.
- 2018:risks, sensitivity points, trade-off points 是什么?各举一个例子。
- 2019:描述在 ATAM 的每一个过程中有哪些 stakeholders 和他们的职责。
- 2021:ATAM 每个阶段的输出。
7. ADD 3.0
- 背 ADD 3.0 基本过程
- 会解释内部视角:基本设计过程
- 会解释外部视角:设计背后的策略和模式选择
- 会写 greenfield for mature domain 的迭代思路
- 会写 brownfield / existing system
- 会解释 Strangler Fig Pattern
高频题干:
Describe the ADD process.
Describe ADD 3.0 process.
对应往年题:
- 2018:描述 ADD 过程。
- 2021:架构一般设计策略是什么?以 ADD 为例说明这些策略如何体现。
- 2025:ADD 3.0 过程。
8. 通用设计策略 General Design Strategy
- 背 decomposition
- 背 abstraction
- 背 divide and conquer
- 背 generate and test
- 背 iteration / incremental refinement
- 背 reusable elements
- 每个策略准备一个架构例子
对应往年题:
- 2017:What are generic design strategies applied in designing software? Give a concise working example with software architecture for each strategy.
- 2019:What are generic design strategies applied in designing software? Give a concise working example with software architecture for each strategy.
- 2022:What are the generic design strategies applied in designing software? Give a concise working example with software architecture for these strategies.
六、架构模式与微服务重点
1. Architecture Pattern 基础
- 会定义 architecture pattern
- 会写 context、problem、solution
- 会解释 pattern 和 tactic 的关系
- 会解释 tactics are simpler than patterns
- 会解释 one does not invent patterns, one discovers them
对应往年题:
- 2015:Describe relationships between architecture patterns and tactics. List four tactics names and describe their usage.
2. C&C 风格
- 会解释 C&C style 的本质:runtime components + connectors
- 会以 SOA 举例说明 components、connectors、约束
- 会解释 Pipe-and-Filter
- 会解释 Broker Pattern 的 context、benefits、limitations
- 会解释 Publish-Subscribe / Observer 在架构题中的映射
对应往年题:
- 2015:Explain the context, benefits and limitations of Broker Architecture Pattern.
- 2018:What is the nature of component-connector style? 以 MVC pattern 举例。
- 2021:组件-连接器样式的本质是什么?以 SOA 模式为例说明。
- 2021:设计一个基于管道-过滤器模式的程序,输入文本文件,输出排序后的无重复单词列表。
- 2022:分布式缓存更新综合题,用 Observer pattern 映射组件,画 sequence diagram,并讨论 connector 或 web services。
- 2025:C&C 风格的性质,以 SOA 举例。
3. SOA 与微服务
- 背 SOA 基本原则:
- service contract
- service encapsulation
- service reuse
- service composition
- service autonomy
- service statelessness
- 会写 SOA 对 interoperability、scalability、security 的影响
- 会比较 SOA 和微服务
- 背微服务六大特性:
- 通过服务组件化
- 围绕业务能力组织
- 内聚和解耦
- 去中心化
- 基础设施自动化
- 服务设计与演进
- 会解释智能端点和哑管道
- 会写微服务挑战:
- 拆分粒度
- 分布式系统复杂性
- 运维要求高
- 发布复杂度
- 部署依赖强
- 通信成本高
对应往年题:
- 2015:Briefly describe the fundamental principles of SOA and discuss the impact of SOA on quality attributes like interoperability, scalability and security.
- 2019:微服务和 SOA 的区别、相同点。
- 2025:微服务架构的主要特征。
4. 微服务拆分与部署
- 会按用户故事提取高频名词,建立领域模型
- 会按动词识别系统操作
- 会根据子域划分微服务
- 会解释限界上下文 bounded context
- 会解释上下文映射
- 会定义服务 API 和协作模式
- 背部署模式:
- 单主机多实例
- 单主机单实例
- 虚拟机
- 容器
- 服务部署平台
- 无服务器
对应往年题:
- 2025:一个大概是外卖平台的情景,为什么适合使用微服务;接下来三问是微服务设计拆分的具体应用,包括操作、微服务、对应关系。
七、英文题干识别表
| 英文关键词 | 立刻想到 |
|---|---|
| stimulus-response | 质量属性场景六要素 |
| ASR | 架构攸关需求 |
| utility tree | ASR 管理 / ATAM |
| views | Views and Beyond / 4+1 |
| Module / C&C / Allocation | 三类架构风格连线题 |
| runtime behavior and interactions | C&C |
| implementation units | Module |
| non-software structures | Allocation |
| surrogate / placeholder | Proxy |
| unified interface | Facade |
| fine-grained objects | Flyweight |
| part-whole hierarchy | Composite |
| incompatible interfaces | Adapter |
| dynamically attach responsibilities | Decorator |
| decouple abstraction from implementation | Bridge |
| parameterize request | Command |
| one-to-many dependency | Observer |
| algorithm family | Strategy |
| state transition | State |
| skeleton of algorithm | Template Method |
八、第一轮复习顺序
- P0/P1 设计模式:原则、工厂、命令、观察者、策略、外观/代理
- 设计题专项:类图 + 时序图 + 代码模板
- P0 架构:质量属性场景、ASR、视图、ATAM、ADD、微服务
- P1 架构:QA 场景建模、ADD 3.0、微服务拆分流程
- P2 概念扫盲:所有模式定义、别名、适用环境、优缺点
- 提示:加分句和易错点
九、考前检查
- 能在 2 分钟内默写质量属性场景六要素
- 能在 5 分钟内画出 4+1 view
- 能在 5 分钟内写出三类 views 的连线题答案
- 能在 5 分钟内写出 ATAM 输出
- 能在 5 分钟内写出 ADD 过程
- 能在 5 分钟内解释 ASR 来源
- 能画出 Strategy、Command、Observer、Composite、Proxy、Facade 类图
- 能写出 push vs pull 的比较
- 能解释 Prototype vs Flyweight
- 能解释 Factory Method / Abstract Factory 如何体现 OCP
- 能做一道微服务拆分题
- 能做一道综合设计题并说明用了哪些模式、解决了什么变化点