Software Design &
Architecture
Dr. Mehvish Rashid
Agenda
• What’s a Design Pattern?
• What does the pattern consist of?
• Importance of Design Patterns
• Levels of Designs
• Design Approaches
• Design Challenges
• Characteristics of Good and Bad Design
• Case Studies & Examples
• Interactive Activities & Exercises
• Summary & Q&A
What is a Design Pattern?
• A design pattern is a general, reusable
solution to a commonly occurring problem
within a given context.
• It provides a template for solving a particular
problem in software design.
• Helps in maintaining best practices and
ensuring efficiency in coding.
What is a Design Pattern?
Key Benefits:
Efficiency – Reduces development time by
reusing proven solutions.
Maintainability – Improves code organization,
making updates easier.
Reusability – Enhances consistency across
different projects.
Examples of Common Design Patterns:
• Singleton – Ensures only one instance of a
class exists.
• Factory – Creates objects without specifying
the exact class.
• Observer – Establishes a one-to-many
dependency for notifications.
What Does a Pattern Consist Of?
Pattern Name: A meaningful name that conveys the pattern’s
purpose.
Problem: Describes the issue the pattern addresses.
Solution: Provides a template on how to solve the problem.
Consequences: The trade-offs and impact of using the
pattern.
Importance of Design Patterns
Encourages reusable and maintainable code.
Helps in improving communication among
developers.
Reduces development time by providing standard
solutions.
Promotes better software design and architecture.
Levels of Design
Architectural Design: High-level structure of
software components.
Detailed Design: Internal logic of each software
component.
Modular Design: Breaking down systems into
independent modules.
Architectural Design
Definition:
Architectural design defines the high-level
structure of a software system, focusing on
components, interactions, and dependencies.
It acts as a blueprint for the entire system,
ensuring scalability, reliability, and maintainability.
Key Aspects:
Defines major components and their
responsibilities.
Establishes how components interact via
interfaces and data flow.
Ensures separation of concerns for better
organization.
Architectural Design
Example:
In a web application, architectural design may
define layers such as:
• Presentation Layer (UI)
• Business Logic Layer
• Database Layer
Benefits:
Provides a clear system structure and
organization.
Supports scalability and future expansion.
Enhances maintainability by enforcing
modularity.
Detailed Design
Definition:
• Detailed design focuses on the internal logic
of each software component or module.
• It includes class structures, algorithms, data
types, and relationships between objects.
Key Aspects:
• Specifies class diagrams, function
breakdowns, and data flow.
• Ensures efficiency in performance and
resource utilization.
• Guides developers on implementation
details at the code level.
Detailed Design
Example:
In a banking system, detailed design
includes:
• How the Transaction Processing module
validates and processes payments.
• How the User Authentication module
verifies login credentials.
Benefits:
Helps developers understand and
implement the system effectively.
Improves code efficiency and
maintainability.
Supports debugging and error handling
with structured design.
Modular Design
Definition:
• Modular design divides a large system into
smaller, independent modules, making it
easier to manage, test, and scale.
• Each module performs a specific function
and can be developed independently.
Key Aspects:
• Encourages reusability by allowing
components to be used in different
applications.
• Reduces complexity by dividing software
into smaller, manageable parts.
• Enhances fault isolation, so errors in one
module do not impact the entire system.
Modular Design
Example:
• In e-commerce platforms, different
modules handle:
• Shopping Cart Module
• User Authentication Module
• Payment Processing Module
Benefits:
Increases flexibility and makes updates
easier.
Enhances team collaboration by enabling
parallel development.
Supports scalability by allowing
independent modifications.
Top-down Design: Starts
from a broad system view
and breaks it down.
Design Bottom-up Design: Begins
with defining low-level
Approaches components first.
Object-Oriented Design:
Uses objects and classes to
define system structure.
Comparison of Design
Approaches
Approach Pros Cons
Top-Down Clear structure, better Can miss low-level issues
organization
Bottom-Up Focuses on reusability Difficult to integrate
OOD Aligns with real-world Requires careful planning
scenarios
Component-Based High modularity, easier May lead to increased
testing complexity
Design Challenges
Scalability: Ensuring the system can handle growth.
Maintainability: Making sure the system is easy to update.
Performance: Ensuring efficiency and speed.
Security: Protecting against vulnerabilities.
Characteristics of Good and Bad Design
Good Design:
• Clear structure and well-documented code.
• Flexible and reusable components.
• Efficient and optimized for performance.
Bad Design:
• Hard-to-read and poorly documented code.
• Too many dependencies and tightly coupled components.
• Difficult to scale and modify.
Real-World Example of Design
Patterns
Example: Observer Pattern in Social Media
Used in notifications and event-driven programming.
A user (subject) has followers (observers) who get notified
when they post.
Benefits: Loose coupling and better scalability.
Interactive Activities & Exercises
Group Discussion: Discuss Coding Exercise: Implement a Case Study: Analyze a popular
real-world applications of Singleton or Factory Pattern in software system that uses
design patterns. a small project. design patterns.
Further Reading
• Books: Recommended • Online: TutorialsPoint.
textbooks.
Q&A Session
Thank You!