Notes on Software Design and Architecture
Notes on Software Design and Architecture
1. Introduction to Design
• Definition: Design in software refers to the process of defining the architecture, components,
interfaces, and other characteristics of a system.
• Purpose: The goal is to create a blueprint that guides the development of the software, ensuring
it meets requirements and is maintainable.
2. Importance of Design
• Quality Assurance: Good design leads to high-quality software that is reliable, efficient, and easy
to maintain.
• Cost-Effectiveness: Investing time in design can reduce costs in the long run by minimizing
changes and rework during development.
• User Satisfaction: A well-designed system enhances user experience and satisfaction by being
intuitive and functional.
3. Difference Between Design and Architecture
• Design: Focuses on the implementation details and how components interact within the system.
• Architecture: Refers to the high-level structure of the software system, including its components
and their relationships. It sets the foundation for the design.
4. Course Structure
• Module 1: Introduction to Software Design
o Covers basic concepts of software design and architectural styles.
• Module 2: Detailed Design Phase
o Focuses on Object-Oriented Design and various design patterns, which are reusable
solutions to common design problems.
5. Motivation for Learning Design
• Understanding design principles is crucial for developing robust software systems.
• It prepares students for real-world challenges in software development and enhances problem-
solving skills.
6. Course Prerequisites
• Software Engineering I: A foundational course that provides an overview of software
development processes.
• Software Requirements Specification: Understanding requirements is essential for effective
design.
Explanation of Key Concepts
• Software Design: This is a critical phase in software development where the focus is on creating
a blueprint for the system. It involves making decisions about how the software will function and
how its components will interact. Good design is essential for ensuring that the software is not
only functional but also maintainable and scalable.
• Software Architecture: This is a higher-level concept that deals with the overall structure of the
software system. It defines the system's components and their relationships, serving as a
framework for the design phase. Understanding architecture helps in making informed decisions
about technology choices and system scalability.
• Design Patterns: These are standard solutions to common problems in software design. Learning
about design patterns is crucial for developing flexible and reusable code. They help in
addressing issues like object creation, structure, and behavior in a systematic way.
2. Types of Requirements
2.1. Functional Requirements (FRs):
• These describe the services or functions the system must provide.
• Examples:
o "The system must authenticate users using a valid email and password."
o "The software must generate daily sales reports for administrators."
2.2. Non-Functional Requirements (NFRs):
• Define constraints or quality attributes of the system, such as:
o Performance: "The system must process 500 transactions per second."
o Security: "All sensitive data must be encrypted using AES-256 encryption."
o Reliability: "System uptime must be 99.99% annually."
2.3. Domain Requirements:
• Specific to the system’s operational environment.
• Example: A hospital management system must comply with local healthcare regulations like
HIPAA (in the USA).
Note: NFRs and domain requirements are often more critical than FRs because failing to meet them can
make the system unusable.
8. Architectural Design
Definition:
Architectural design specifies the major components of the system and their interactions.
Benefits:
1. Stakeholder Communication: Serves as a blueprint for discussing the system structure.
2. Reuse: A well-designed architecture can be applied to similar systems.
System Characteristics to Consider:
• Performance: Ensure the design meets speed requirements.
• Reliability: Address fault tolerance and error recovery.
• Security: Protect against unauthorized access.
• Maintainability: Design should support updates with minimal effort.
9. Stages of Design
1. Problem Understanding:
o Analyze requirements from multiple perspectives.
2. Identify Solutions:
o Brainstorm possible approaches and evaluate them.
3. Describe Abstractions:
o Use models like flowcharts or Unified Modeling Language (UML) diagrams.
4. Iterate:
o Refine the design based on stakeholder feedback.
3. SOLID Principles
The SOLID principles guide developers in creating robust, maintainable software.
1. Single Responsibility Principle (SRP):
• Definition: A class should have only one reason to change.
• Explanation: Each class should handle a single functionality. Combining responsibilities increases
the risk of unexpected changes.
• Example:
Bad:
java
Copy code
class Employee {
public Pay calculatePay() {...}
public void save() {...}
public void generateReport() {...}
}
Problem: Pay calculation, saving, and report generation are unrelated responsibilities.
Solution: Separate into multiple classes.
java
Copy code
class Payroll { public Pay calculatePay() {...} }
class EmployeeData { public void save() {...} }
class ReportGenerator { public void generateReport() {...} }
4. Design Patterns
Definition:
Design patterns are proven solutions to recurring design problems. They provide templates for writing
code that is efficient, reusable, and maintainable.
3. Architectural Styles
3.1 Pipes and Filters
• Definition: The system is composed of filters (components) and pipes (connectors).
• Components:
o Filters: Transform input data to output.
o Pipes: Connect filters and handle data flow.
Advantages:
• Reusable filters.
• Easy to understand and extend.
Disadvantages:
• Batch processing limits interactive applications.
Examples:
• UNIX shell commands.
• Compilers (lexical analysis, syntax checking).