Four patterns,
four ways components talk.
Same question every time: who is allowed to talk to whom? Blackboard says "only through me." Pipes-and-Filters says "only to your neighbor." Client-Server says "only to the one server you know." Broker says "to anyone, through me, and you'll never know the difference."
Two roles: one manager, many workers
Data-centered systems decompose around one main central repository. Every system in this family has exactly two kinds of roles:
Controls, provides, and manages access to the system's data — the gatekeeper.
Execute operations and perform work based on that data.
Opportunistic problem-solving around a shared space
Blackboard
central data, independent agentsComponents work around a central data component to provide solutions to complex problems — independently, with no predetermined or "correct" sequence of operations. Famous for depicting the logical architecture of expert systems (AI that mimics human decision-making using knowledge + inference rules).
| Blackboard | The patient's chart — visible & updated by everyone |
| Agents | Doctors, nurses, specialists — each updates based on their expertise |
| Controller | Manages who gets access when, based on the patient's changing condition |
| Blackboard → | Provides read/write/update interfaces — it's the central hub everyone needs. |
| Controller → | Does not provide data interfaces to Agents; its job is to orchestrate, not store. It just says "go check the Blackboard." |
| Agents → | Provide a service interface (e.g. run()) so the Controller can
invoke them on demand. |
StudentHistory, CourseOfferings, and WorkSchedule are
Agents; ScheduleManager is the Controller; ScheduleBlackboard holds
the draft schedule via getSchedule()/setSchedule().
- Client calls
generateSchedule()on the ScheduleManager. - ScheduleManager picks the next Agent via
nextScheduler()and callsworkOnSchedule(). - That Agent reads the draft from the Blackboard (
getSchedule()), improves it, and writes it back (setSchedule()). - Control returns to the Manager, which repeats for the next Agent — until the schedule is finalized and delivered to the Client.
| Quality | Why |
|---|---|
| Modifiability | Agents are compartmentalized/independent — easy to add or remove an agent (e.g. a new
SportsSchedule agent) without touching the others. |
| Reusability | Specialized agents can be reused elsewhere — e.g. StudentHistory reused in
a graduation checker. |
| Maintainability | Separation of concerns means a bug in one agent (e.g. CourseOfferings) can
be fixed without touching WorkSchedule. |
Two roles again — but this time in a chain
Decomposed around transporting and transforming data along the way to meet application-specific needs.
Abstract the transformations/processing before forwarding a data stream: encryption/decryption, compression/decompression, changing format (binary → XML), enhancing/modifying/storing data.
Abstract the management and control of the data transport mechanisms — how the data physically moves between workers.
A chain where each link transforms the data
Pipes-and-Filters
sequential transformation| Lexical Analyzer | Breaks source code into tokens. E.g. int x = 5; → tokens int,
x, =, 5, ; |
| Parser | Builds a parse tree from the tokens representing grammatical structure. |
| Code Generator | Translates the parse tree into machine code / an intermediate representation. |
| Optimizer | Makes the code faster / leaner — e.g. merges two memory operations into one instruction. |
| Interpreter | (Alternative to compiling) executes the code directly from its high-level or intermediate form, without producing machine code. |
Each stage transforms the data into something
more specific: raw video → detected faces → recognized identities → an identity report. In one
real implementation, the "pipe" between filters is literally .NET's
FileSystemWatcher — when a filter writes a file, the next filter is
notified and picks it up.
| Quality | Why |
|---|---|
| Extensibility | New filters (e.g. a spam filter) drop in easily. |
| Efficiency | Filters connected in parallel can run concurrently, reducing latency. |
| Reusability | Compartmentalized pipes and filters can be reused as-is in other systems. |
| Modifiability | Filters are independent — easy to add, remove, or swap. |
| Security | Security filters can be injected at any point in the data flow. |
| Maintainability | Independent filters mean maintaining one doesn't disturb the others. |
Two shapes: hub-and-spoke, or all-equal peers
Decomposed into multiple processes that (typically) collaborate through a network.
Client-Server
- One or more processes work on behalf of client users
- They bridge to a remote server that performs delegated work
- Example: a web browser talking to a web server
Peer-to-Peer
- Peer nodes with similar capabilities
- Collaborate together, no central server
- Example: music/file-sharing apps like BitTorrent
Many independent clients, one server
Client-Server
direct, tightly coupledServer: a program or device providing functionality to clients. Client: hardware/software that accesses a service made available by a server. Multiple clients talk to the server, but clients are independent — they never talk to each other.
pc_browser.exe, a
Mobile Node runs mp_browser.exe, both send HTTP requests to a Server
Node running web_server.exe, which responds with processed data. A deployment
diagram maps these artifacts (programs) onto nodes (hardware) — different from a
component diagram, which maps software components and their dependencies, not hardware.| Quality | Why |
|---|---|
| Interoperability | Clients on different platforms can interoperate with servers on different platforms. |
| Modifiability | Server changes are centralized and quickly distributed to many clients. |
| Availability | Multiple backup server nodes can be connected to increase availability. |
| Reusability | Separating server from clients lets services/data be reused across applications. |
A mediator so clients never need to know the server
Broker
indirect, loosely coupledThe broker (a mediator/middleware) coordinates communication between clients and servers — forwarding requests, transmitting results and exceptions — so one client can transparently access the services of multiple servers.
| Component | Job |
|---|---|
| Client | Application that uses services from one or more servers. |
| ClientProxy | Makes remote components look local to the Client; decides whether a request can be resolved locally or must go to the Broker. |
| Broker | Mediates between client and server components — the mediator everyone routes through. |
| ServerProxy | Makes remote components look local to the Server. |
| Server | Provides services to clients; may itself act as a client to another Broker. |
| Bridge | Optional — encapsulates interoperation between different Brokers. |
Client-Server
- Direct communication, client ↔ server
- Client must know the server's exact address/protocol
- Tightly coupled — server changes force client updates
- Simpler, but doesn't scale well to multiple servers
Broker
- Indirect communication, through a middleware broker
- Clients only need to know the broker, not the server
- Loosely coupled — server changes don't touch clients
- Scales to multiple servers/services transparently
| Quality | Why |
|---|---|
| Interoperability | Clients on different platforms interoperate with servers on different platforms — and transparently with multiple servers. |
| Modifiability | Centralized server changes distribute quickly to many clients. |
| Portability | Porting the broker to new platforms makes services easily reachable by new clients. |
| Reusability | Brokers abstract away communication calls, so complex services can be reused across applications. |
All four patterns, side by side
| Pattern | Family | Core roles | Coupling | Signature quality win |
|---|---|---|---|---|
| Blackboard | Data-Centered | Blackboard, Agents, Controller | Loose — agents never talk directly | Modifiability (swap agents freely) |
| Pipes-and-Filters | Data Flow | Source, Filter, Pipe, Sink | Loose — each filter only knows its pipe | Extensibility & parallel efficiency |
| Client-Server | Distributed | Client, Server | Tight — client must know the server | Availability (backup server nodes) |
| Broker | Distributed | Client, ClientProxy, Broker, ServerProxy, Server, Bridge | Loose — client only knows the broker | Interoperability across multiple servers |