Architectural Patterns

An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context.
Architectural patterns are similar to software design pattern but have a broader scope.

Layered

Structure programs that can be decomposed into groups of subtasks, each of which is at a particular level of abstraction.
Each layer provides services to the next higher layer.

The most commonly found 4 layers of a general information system are as follows (it is also the order of layers):

It can be described as:

Usage:

Client-server

Consists of two parties; a server and multiple clients.
The server component will provide services to multiple client components.
Clients request services from the server and the server provides relevant services to those clients.
Furthermore, the server continues to listen to client requests.

Usage:

Master-slave

Consists of two parties; master and slaves.
The master component distributes the work among identical slave components, and computes a final result from the results which the slaves return.

Usage:

Pipe-filter

Structure systems which produce and process a stream of data.
Each processing step is enclosed within a filter component.
Data to be processed is passed through pipes. These pipes can be used for buffering or for synchronization purposes.

Usage:

Broker

Structure distributed systems with decoupled components.
These components can interact with each other by remote service invocations.
A broker component is responsible for the coordination of communication among components.

Servers publish their capabilities (services and characteristics) to a broker.
Clients request a service from the broker, and the broker then redirects the client to a suitable service from its registry.

Usage:

Peer-to-peer

Individual components are known as peers.
Peers may function both as a client, requesting services from other peers, and as a server, providing services to other peers.
A peer may act as a client or as a server or as both, and it can change its role dynamically with time.

Usage:

Event-bus

Primarily deals with events and has 4 major components; event source, event listener, channel and event bus.
Sources publish messages to particular channels on an event bus.
Listeners subscribe to particular channels.
Listeners are notified of messages that are published to a channel to which they have subscribed before.

Usage:

Model-view-controller

Also known as MVC pattern, divides an interactive application in to 3 parts as:

This is done to separate internal representations of information from the ways information is presented to, and accepted from, the user.
It decouples components and allows efficient code reuse.

Usage:

Blackboard

Useful for problems for which no deterministic solution strategies are known.
The blackboard pattern consists of 3 main components:

All the components have access to the blackboard.
Components may produce new data objects that are added to the blackboard.
Components look for particular kinds of data on the blackboard, and may find these by pattern matching with the existing knowledge source.

Usage:

Interpreter

Used for designing a component that interprets programs written in a dedicated language.
It mainly specifies how to evaluate lines of programs, known as sentences or expressions written in a particular language.
The basic idea is to have a class for each symbol of the language.

Usage:

Up Next

In the next step, we will dive into popular design patterns ware reusable solutions to common software design problemslike Singleton, Observer, Factory, and more. By incorporating these patterns into your designs, you can enhance code reusability, maintainability, and flexibility.