Skip to Content
软件架构师速成指南
book

软件架构师速成指南

by Gregor Hohpe
May 2025
Beginner to intermediate
368 pages
3h 30m
Chinese
O'Reilly Media, Inc.
Content preview from 软件架构师速成指南

第 8 章 这是建筑吗?

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

寻找决定!

Would you pay an architect for this?
你会为此花钱请建筑师吗?

作为首席架构师,我的工作之一就是审查和批准系统架构。当我要求团队向我展示 "他们的架构 "时,我常常不认为我收到的是一份架构文档。他们反问我 "你期望什么?",我却不太容易回答:尽管有许多正式的定义,但架构是什么或一份文档是否真正描述了架构,并不是一目了然的。很多时候,我们不得不回到美国最高法院法官对淫秽材料所采用的著名的 "我一看就知道 "的检验标准。1我们希望识别建筑是一项比识别淫秽材料更崇高的任务,所以让我们再努力一点。我不太相信包罗万象的定义,而更喜欢使用一些可以应用的定义特征或测试清单。我最喜欢对架构文档进行的测试之一,就是它是否包含任何非同小可的决定及其背后的理由。

定义软件架构

在定义软件架构方面有太多的尝试,以至于软件工程研究所(SEI)为这些定义建立了一个参考页面

其中使用最广泛的是 Garlan 和 Perry 于 1995 年提出的定义:

一个系统各组成部分的结构、相互关系,以及指导其设计和随时间演变的原则和准则。

2000 年,ANSI/IEEE Std 1471 选择了以下定义(2007 年被采纳为 ISO/IEC 42010):

一个系统的基本组织,体现在其各个组成部分、它们之间的关系和环境,以及指导其设计和演变的原则。

开放集团为 TOGAF 采用了其变体:

各组成部分的结构、相互关系以及指导其设计和随时间演变的原则和准则。

德斯蒙德-德索萨(Desmond D'Souza)和艾伦-卡梅隆-威尔斯(Alan Cameron Wills)的《催化法》一书是我的个人最爱之一:2

有关任何系统的一系列设计决定,使其实施者和维护者不会发挥不必要的创造力。

这里的关键点并不是说建筑应该抑制所有的创造力,而是说不必要的创造力,我亲眼目睹了大量这样的创造力。它还强调了决策的重要性(第 6 章)。

建筑决策

然而,当有人拿着一张显示方框和线条(第 23 章)的 PowerPoint 幻灯片,声称 "这就是我的系统架构 "时, ,这些经过深思熟虑的定义并不容易使用。我倾向于采用的第一个测试标准是文档是否包含有意义的决策。毕竟,如果不需要做出任何决定,那为什么还要雇用架构师和准备架构文档呢?

马丁-福勒(Martin Fowler) ,他善于用极其简单的例子来解释事物的本质,这促使我用我能想到的最简单的例子来说明 "架构决策测试",并将其与建筑架构进行类比(我承认这种类比很蹩脚)。

看图 8-1 左侧的房屋图。这幅图包含了流行的系统架构定义所要求的许多元素:我们看到了系统的主要组成部分(门、窗、屋顶)及其相互关系(门窗在墙上,屋顶在顶部)。不过,我们对其设计原则的了解可能略显单薄,但我们确实注意到,我们有一扇直达地面的门和多扇窗户,这遵循了常见的建筑原则。

Is this architecture?
图 8-1. 这是架构吗?

然而,要建这样一栋房子,我可不想花钱请建筑师。这栋房子是 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

游戏化头脑风暴

游戏化头脑风暴

Dave Gray, Sunni Brown, James Macanufo
超越Vibe编程

超越Vibe编程

Addy Osmani

Publisher Resources

ISBN: 9798341658028