10 Common Software Architectural Patterns and Their Uses
This article introduces ten widely used software architectural patterns—including layered, client‑server, master‑slave, pipe‑filter, broker, peer‑to‑peer, event‑bus, MVC, blackboard, and interpreter—explaining their structures, typical applications, advantages, and disadvantages, and provides a comparative overview.
Before starting a large‑scale software project, selecting an appropriate architecture is crucial for meeting functional and quality requirements. This article explains what an architectural pattern is—a reusable solution to common software‑architecture problems—and presents ten typical patterns.
1. Layered Pattern : Organizes a system into hierarchical layers (presentation/UI, application/service, domain/business logic, and data access/persistence). Each layer offers services to the one above it. Commonly used in desktop applications and e‑commerce web systems.
2. Client‑Server Pattern : Consists of a server component that provides services to multiple client components. Clients request services; the server continuously listens for requests. Typical for online applications such as email, document sharing, and banking.
3. Master‑Slave Pattern : A master component distributes work among multiple slave components and aggregates their results. Used in database replication (master DB with synchronized slaves) and peripheral devices connected to a system bus.
4. Pipe‑Filter Pattern : Constructs a system as a series of processing steps (filters) linked by pipes that pass data streams. Examples include compilers (lexical analysis → parsing → semantic analysis → code generation) and bio‑informatics workflows.
5. Broker Pattern : Enables distributed systems with separated components to communicate via a broker that mediates service registration and request routing. Common in messaging middleware such as Apache ActiveMQ, Kafka, RabbitMQ, and JBoss Messaging.
6. Peer‑to‑Peer Pattern : Each component (peer) can act as both client and server, requesting and providing services to other peers. Used in file‑sharing networks (Gnutella, G2) and multimedia protocols (P2PTV, PDTP).
7. Event‑Bus Pattern : Centers on event handling with four main parts: event source, listeners, channels, and the bus itself. Widely used in Android development and notification services.
8. Model‑View‑Controller (MVC) Pattern : Splits an interactive application into Model (core data and logic), View (user interface), and Controller (input handling). Enables separation of concerns and code reuse; forms the basis of many web frameworks such as Django and Rails.
9. Blackboard Pattern : Suits problems without a deterministic solution strategy. Consists of a global blackboard (shared memory), knowledge sources (specialized modules), and a control component that selects and executes modules. Applied in speech recognition, vehicle tracking, protein structure identification, and sonar signal interpretation.
10. Interpreter (Parser) Pattern : Designs components that interpret programs written in a specific language, defining how each symbol is processed. Used for database query languages like SQL and for describing communication protocols.
The article concludes with a comparative table summarizing the advantages and disadvantages of each pattern, followed by references to the original Medium article and the author's website, and promotional links to WeChat public accounts, knowledge circles, and audio platforms.
Architects Research Society
A daily treasure trove for architects, expanding your view and depth. We share enterprise, business, application, data, technology, and security architecture, discuss frameworks, planning, governance, standards, and implementation, and explore emerging styles such as microservices, event‑driven, micro‑frontend, big data, data warehousing, IoT, and AI architecture.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.