Software Engineering basics - Architectural Design
Architectural Design
Definition:
Architectural design is the high-level structure of a software system that defines how the system is organized into components (modules), how these components interact, and how they work together to fulfill system requirements.
It’s often called the “blueprint” of the system — providing an overview of the software’s overall structure before detailed design and coding begin.
Purpose of Architectural Design
-
To define the main components or modules of a system.
-
To specify relationships and communication between components.
-
To ensure the system meets functional and non-functional requirements (like performance, scalability, security, and maintainability).
-
To provide a foundation for detailed design and implementation.
Key Activities in Architectural Design
-
Identify System Components:
Break the system into major functional units or modules. -
Define Interactions:
Describe how modules communicate (e.g., via APIs, message passing, or shared data). -
Select Architectural Style:
Choose a suitable architecture based on system needs — for example, layered, client-server, microservices, or event-driven. -
Define Interfaces:
Specify inputs, outputs, and data flow between modules. -
Evaluate the Architecture:
Ensure it meets quality attributes such as scalability, reliability, and security.
Common Architectural Styles
| Style | Description | Example |
|---|---|---|
| Layered Architecture | System is divided into layers (presentation, business, data). | Web applications |
| Client-Server Architecture | Server provides services; client requests them. | Email, databases |
| Microservices Architecture | System is divided into small, independent services. | Netflix, Amazon |
| Pipe-and-Filter Architecture | Data flows through a series of processing components. | Compiler design |
| Event-Driven Architecture | Components communicate via event notifications. | IoT systems |
Example: Online Shopping System
Scenario:
You are designing an e-commerce application (like Amazon).
Architectural Design:
-
Layers (Layered Architecture):
-
Presentation Layer: Handles user interface (web pages, mobile app).
-
Business Logic Layer: Manages operations like product search, order processing, and payments.
-
Data Access Layer: Communicates with the database to store and retrieve data.
-
Database Layer: Stores product details, user accounts, orders, etc.
-
-
Interactions:
-
The user interacts with the presentation layer.
-
The presentation layer calls services in the business logic layer.
-
The business layer fetches or updates information through the data access layer, which communicates with the database.
-
Textual Diagram of a Layered Architecture
+-----------------------------+
| Presentation Layer |
| (UI: Website / Mobile App) |
+-------------+---------------+
|
v
+-----------------------------+
| Business Logic Layer |
| (Order, Cart, Payment Logic)|
+-------------+---------------+
|
v
+-----------------------------+
| Data Access Layer |
| (Database Connectivity) |
+-------------+---------------+
|
v
+-----------------------------+
| Database Layer |
| (Products, Users, Orders) |
+-----------------------------+
Benefits of Architectural Design
-
Provides a clear system overview for all stakeholders.
-
Improves modularity and maintainability.
-
Helps in scalability and performance planning.
-
Makes future changes and enhancements easier.
In Summary
| Aspect | Description |
|---|---|
| Goal | Define the structure and interaction of system components. |
| Focus | System organization, communication, and data flow. |
| Output | Software Architecture Document (SAD) or architectural diagram. |
| Example | Layered architecture for an e-commerce site. |