"The First Law of Software Architecture is: Everything in software architecture is a trade-off"
《Head First Software Architecture》
software architecture
is less about appearance and MORE about structure, whereas design
is MORE about appearance and LESS about structure.software architecture
: architectural characteristics
, architectural decisions
, logical components
, and architectural style
.Architectural characteristics
form the foundational aspects of software architecture
. You must know which architectural characteristics
are most important to your specific system, so you can analyze trade-offs and make the right architectural decisions
.Architectural decisions
serve as guideposts to help development teams understand the constraints and conditions of the architecture.logical components
of a software architecture
solution make up the building blocks of the system. They represent things the system does and are implemented through class files or source code.architectural styles
you can use. Each style supports a specific set of architectural characteristics
, so it's important to make sure you select the right one (or combination of them) for your system.Architectural characteristics
represent one part of the structural analysis that architects use to design software systems.Architectural characteristics
describe a system's capabilities.architectural characteristics
overlap with operational concerns (such as availability
, scalability
, and so on).architectural characteristics
. No one can make a comprehensive list, because the software development ecosystem is constantly changing.architectural characteristics
, architects look for factors that influence structural design.architectural characteristics
, because they are synergistic—changing one requires other parts of the system to change.architectural characteristics
are implicit: not explicitly stated in requirements, yet part of an architect's design.architectural characteristics
may appear in multiple categories.architectural characteristics
are cross-cutting: they interact with other parts of (and decisions in) the organization.architectural characteristics
from requirements and other domain design considerations.architectural characteristics
come from domain and/or environmental knowledge, outside of the requirements of a specific application.architectural characteristics
are composites: they consist of a combination of other architectural characteristics
.architectural characteristics
.architectural characteristics
they consider to some small number, such as seven.software architecture
is "it depends." To learn which solutions are best for your situation, you'll need to identify the top priorities and goals. What are the requirements? What's most important to your stakeholders and customers? Are you in a rush to get to market, or hoping to get things stable in growth mode?architectural decision
: one of the four dimensions needed to describe any architecture.architectural decision
involves looking at the pros and cons of every choice in light of other constraints—such as cultural, technical, business, and customer needs—and choosing the option that serves these constraints best.architectural decision
isn't just about choosing; it's also about why you're choosing that particular option.architectural decisions
, use architectural decision records
(ADRs). These documents have seven sections: Title, Status, Context, Decision, Consequences, Governance, and Notes.architectural decisions
that will serve as the memory store of your project.Logical components
are the functional building blocks of a system.logical component
is represented by a directory structure—the folder where you put your source code.logical architecture
involves four continuous steps: identify components, assign requirements, analyze component responsibilities, and analyze architectural characteristics.logical components
by assigning the steps in a primary customer journey to components.logical components
by identifying the actors in the system and assigning their actions to components.logical architecture
involves adding the afferent and efferent coupling levels for each component (CA+CE).architectural styles
—in fact, too many to count.architectural styles
. One is by their partitioning style. Architectural styles
can be either technically partitioned or domain partitioned.architectural styles
, the code is split up by technical concern. For example, there might be a presentation layer and a services layer.architectural styles
, the code is instead split up by problem domain.architectural styles
is by their deployment model. Monolithic architectural styles
deploy all the logical components
that make up an application as a single unit. Distributed architectural styles
deploy the logical components
separately from one another, as multiple units.logical components
are deployed separately, allowing different parts of the application to scale independently of one another.layered architecture
is monolithic: the entire system (code and database) is deployed as a single unit.layered architecture
supports feasibility well; it is easy to understand and it lets you build simple systems quickly.layered architecture
supports excellent separation of technical concerns, making it easy to add new capabilities like user interfaces or databases.layered architecture
mimics some of the same concerns as the Model-View-Controller design pattern, but translated into physical layers and subject to real-world constraints.layered architecture
's capabilities degrade over time if teams continue to add functionality due to eventual resource limits (for example, they run out of memory).layered architecture
provides excellent support for specialization (user interface designers, coders, database experts, and so on).Logical components
represent the problem domain, yet layers focus on technical capabilities, requiring translation between the domain and architecture.layered architecture
may manifest in several physical architectures, including two-tier (also known as client/server), three-tier (web), and embedded/mobile.layered architecture
facilitates this.modular monolith
is a monolithic architectural style that is partitioned by domains and subdomains that reflect business concerns, not technical concerns.modular monolith
remain separate and distinct.modular monolith
using a variety of techniques. Some languages have built-in support for building modules.microkernel architectural style
provides a structured way to handle customizations via plugins.Microkernel architectures
consist of two main parts: the core and one or more plugins.Microkernel architectures
can be monolithic architectures or can be implemented as services in a distributed architecture.Microkernel architectures
are best suited for problems with distinct categories of volatility.microkernel style
shows up in lots of places: IDEs, text processing tools, build and deployment tools, integrations, translation layers, insurance applications, and electronics recycling applications, just to name a few.logical components
and creating a corresponding logical architecture
, try to avoid adding physical details such as services, databases, queues, and user interfaces—those artifacts go into the physical architecture.architectural style
, make sure you consider the characteristics of the architectural style, the problem domain, and the driving architectural characteristics you identified.architectural styles
) are very common. If you use one, be sure to verify that it addresses your critical architectural characteristics
.Architectural decision records
(ADRs) are a great way to document your choices. They communicate the reasons for your architectural decisions
as well as your trade-off analysis.logical architecture
.software architecture
. As long as you can provide a reasonable justification for your architectural decisions
, you're on the right track.microservice
is a single-purpose, separately deployed unit of software that does one thing really well.microservices architectural style
.event-driven architecture
.Event-driven architecture
(EDA) is fast because it generally uses asynchronous (async) communication—services don't wait for a response or acknowledgment from other services when sending them information.event-driven architecture
can use a variety of database topologies:Event-driven architecture
and microservices are very different architectural styles:Microservices architecture
is built on request processing—processing a command or request about something that needs to happen.logical components
and creating a corresponding logical architecture
, try to avoid adding physical details such as services, databases, queues, and user interfaces—those artifacts go into the physical architecture.architectural style
, make sure you consider the characteristics of the architectural style, the problem domain, and the driving architectural characteristics you identified.architectural styles
) are very common. Just be sure to verify that the hybrid architecture still addresses your critical architectural characteristics
.Architectural decision records
(ADRs) are a great way to document your choices. They communicate the reasons for your architectural decisions
as well as your trade-off analysis.logical architecture
.software architecture
. As long as you can provide a reasonable justification for your architectural decisions
, you are on the right track.文章标题 | 《Head First Software Architecture》阅读笔记 |
发布日期 | 2025-08-06 |
文章分类 | Reading |
相关标签 | #Reading #软件架构 #设计模式 |