Software Project
Management
Lecture 23
Software Architecture and Design
Pattern
What are Functional and Nonfunctional
Requirements
Can you state what are Software Metrics
and its types
Can you remember what are user stories
and user personas
Session Objective
By the end of this class, you will be able to:
▪ Explore common architectural styles and
evaluation methods.
▪ Explore commonly used design patterns and
their benefits.
▪ Highlight the significance of version control,
code reviews, and documentation.
▪ Share real-world case studies and encourage
practical application in a workshop setting.
▪
▪
What are Software Architecture and
Patterns
What are Design Patterns and their Types
Learn about Code Reusability and
Maintainability
What is
Software Architecture ?
Software architecture refers to the high-level structure and
organization of a software system. It encompasses the design
decisions that dictate how various components of the system
interact with each other, how data flows between these
components, and how the system achieves its intended
functionality while meeting specific quality attributes.
Importance of Architecture
▪Guidance and Direction: A well-defined
architecture provides a clear direction for the
development team.
▪Complexity Management: Software systems are
often complex, and architecture provides a
structured way to manage this complexity by
breaking it down into manageable components
and defining their interactions.
▪Quality Attributes: Architecture directly impacts
the quality attributes of a system, such as
performance, scalability, reliability,
maintainability, and security.
▪Cost and Time Efficiency: Addressing
architecture-related concerns early in the
development process can prevent costly and
time-consuming rework later.
Role of Architecture Compliance
Consistency: Adhering to the established architecture ensures that the system's
components and interactions remain consistent throughout the development
lifecycle.
Quality Attributes: Architecture compliance directly supports the achievement of
desired quality attributes.
Risk Mitigation: Deviating from the architecture can introduce risks and
uncertainties. By complying with the architecture, developers mitigate the risk of
introducing design flaws, performance bottlenecks, or security vulnerabilities.
Maintenance and Troubleshooting: When the system is in production, adhering to
the architecture simplifies maintenance and troubleshooting.
Long-term Viability: Architecture compliance ensures that the system remains
viable and maintainable over time.
Principles of Software Architecture Compliance
Modularity and Abstraction and
Separation of Concerns
Component-Based Design Encapsulation
Modularity involves Separation of concerns Abstraction involves
breaking down a software aims to divide a software presenting essential
system into smaller, system into distinct features while hiding
self-contained units or sections, each addressing unnecessary details.
components. Each module a specific aspect or Encapsulation involves
should have well-defined responsibility. This bundling data and the
interfaces and interactions principle enhances the methods that operate on
with other modules. system's clarity, that data into a single unit,
maintainability, and or class.
flexibility.
Architecture patterns
used in software
engineering
1. Architecture Patterns
Architecture patterns in software engineering are
high-level structural templates that guide the
organization, design, and development of software
systems.
These patterns provide proven solutions to common
architectural challenges, offering a foundation for
creating systems that are scalable, maintainable, and
adaptable.
2. Monolithic Architecture
In a monolithic architecture, the entire software
application is designed and built as a single, tightly
integrated unit. All components and functionalities
are packaged together, often resulting in a single
codebase.
Monolithic architectures are simple to develop
initially and can be easier to deploy. However, they
can become challenging to maintain and scale as the
application grows. Changes or updates in one part of
the application may impact the entire system.
Monolithic architectures are suitable for smaller
projects or when rapid development is a priority.
Example of Monolithic Approach
Consider an example of an e-commerce
application, that authorizes customers, takes an
order, checks product inventory, authorizes
payment and ships ordered products.
This application consists of several components
including an e-store user interface for customers
(Store web view) along with some backend
services to check product inventory, authorize
and charge payments, and shipping orders.
Monolithic Architecture (for
e-commerce Applications)
Despite having different
components/modules/services, the
application is built and deployed as
one Application for all platforms (i.e.
desktop, mobile, and tablet) using
RDBMS as a data source. Benefits and
Drawbacks of Monolithic Architecture.
Microservices Architecture
▪ Microservices architecture is an approach
where a software application is broken down
into smaller, loosely coupled services that
communicate with each other through
well-defined APIs. Each service is responsible
for a specific business capability or
functionality.
▪ This architecture promotes modularity,
scalability, and flexibility. Different services
can be developed, deployed, and maintained
independently, allowing for rapid iteration and
development. Microservices are well suited for
complex, large-scale applications where
different parts of the system can evolve
independently and require different
technologies or languages.
Layered Architecture
▪ Layered architecture is a structural pattern where
the components of a system are organized into
layers, each with a specific responsibility.
▪ The most common layers include presentation (user
interface), business logic, and data storage. Each
layer communicates only with the adjacent layers
through well-defined interfaces.
▪ This pattern promotes the separation of concerns
and maintainability. Changes to one layer typically
do not affect other layers, making it easier to
modify or replace individual components without
disrupting the entire system.
Event-Driven Architecture
▪ Event-driven architecture (EDA) is a
paradigm where system components
communicate through the exchange of
events.
▪ An event is a signal that something of
interest has happened. Components can
produce and consume events
asynchronously, enabling loose coupling
between different parts of the system.
▪ This architecture is particularly useful
for handling real-time or asynchronous
processing, and it can help build
systems that are responsive to changes
and events in the environment.
What are Software Architecture and
Patterns
What are Design Patterns and their Types
Learn about Code Reusability and
Maintainability
Design Patterns
Design patterns are reusable solutions to common design
problems that arise during software development. They
provide a set of proven and well-established solutions that
help developers create software that is more maintainable,
efficient, and scalable.
Types of Design patterns
Creational Patterns Structural Patterns Behavioral Patterns
Creational patterns focus on Structural patterns address Behavioral patterns focus on
object creation mechanisms, the composition of classes communication and
helping to manage the process and objects to form larger collaboration between
of object instantiation. They structures while maintaining objects. They define ways in
provide ways to create objects flexibility and efficiency. They which objects interact to
in a manner that enhances help define relationships achieve certain behaviors or
flexibility, reusability, and between different functionalities. These
control over the creation components, making it easier patterns enhance the
process. to create complex systems flexibility of communication
while keeping them easy to between objects and help
understand and modify. manage complex interactions.
Benefits of Using Design Patterns
▪ Reusability: Design patterns provide well-tested
solutions that can be reused across different
projects, saving time and effort.
▪ Maintainability: Design patterns promote a clear
and organized structure, making code easier to
understand, modify, and maintain over time.
▪ Scalability: By using design patterns, systems
can be designed to be more adaptable and
scalable, facilitating future enhancements and
modifications.
▪ Best Practices: Design patterns encapsulate
best practices and established architectural
approaches, ensuring the software adheres to
proven principles.
Common Design Patterns
Common design patterns in software engineering are
reusable solutions to common problems that arise during the
design and development of software systems. These patterns
provide a structured approach to solving recurring design
challenges, helping software developers create
well-organized, maintainable, and scalable code.
Types of Common Design Patterns
Singleton Pattern: The Singleton Factory Pattern: The Factory pattern
pattern ensures that a class has only provides an interface for creating
one instance and provides a global objects in a superclass but allows
point of access to that instance. This is subclasses to alter the type of objects
1 useful when you want to control 2 that will be created. It abstracts the
access to a shared resource, such as a process of object creation, making the
database connection or a code more flexible and easier to
configuration object. maintain.
Types of Common Design Patterns
Observer Pattern: The Observer MVC (Model View Controller) Pattern:
pattern defines a one-to-many The MVC pattern separates an
relationship between objects. When application into three main components:
one object (the subject) changes state, Model, View, and Controller. The Model
3 all its dependents (observers) are 4 represents the data and business logic,
notified and updated automatically. the View handles the presentation and
user interface, and the Controller
manages the communication between
the Model and the View.
What are Software Architecture and
Patterns
What are Design Patterns and their
Types
Learn about Code Reusability and
Maintainability
SOLID Principles
Single Responsibility Principle (SRP): A class should have only one reason to
1 change, meaning it should have only one responsibility or job.
Open/Closed Principle (OCP): Software entities (classes, modules, functions)
2 should be available for extension but closed for modification. New functionality
should be added through extensions, not by modifying existing code.
Liskov Substitution Principle (LSP): Subtypes must be substitutable for their base
3 types without affecting the correctness of the program. In other words, derived
classes should be able to replace their base classes without causing issues.
Interface Segregation Principle (ISP): Clients should not be forced to depend on
4 interfaces they don't use. It's better to have smaller, focused interfaces rather than
large, all-encompassing ones.
Dependency Inversion Principle (DIP): High-level modules should not depend on
5 low-level modules. Both should depend on abstractions. Abstractions should not
depend on details; details should depend on abstractions.
Code Reusability and
Maintainability
Code Reusability
Code reusability is the practice of designing and writing code in such a way that it can be easily
used in multiple parts of a software system or even in different projects.
Strategies for achieving code reusability:
1 2 3 4
Modularity DRY (Don't Repeat Separation of
Abstraction
Yourself) Concerns
Divide your code into small, Avoid duplicating code by Keep different aspects of Use abstractions to
cohesive modules or creating reusable functions, your codebase (For encapsulate complex
classes with well-defined classes, or components. example., UI, business logic, behavior and provide a clear
responsibilities. This This improves data access) separate. This interface for interacting
promotes reusability and maintainability and reduces makes code easier to with the underlying
simplifies maintenance. the risk of introducing understand, modify, and implementation.
inconsistencies. test.
Code Maintainability
Code maintainability refers to the ease with which code can be understood, modified, and
extended over time.
Strategies to enhance code maintainability
1 2 3 4
Coding Standards Comments and Version Control Testing and Test
Documentation Automation
Follow coding conventions Add clear and concise Use a version control Write unit tests and
and style guides specific to comments to explain system like Git to track integration tests for your
your programming complex sections of code, changes and collaborate code. Automated testing
language or team. algorithms, or tricky logic. with other developers. ensures that changes to the
Consistent code formatting Keep documentation up to Branching and merging codebase do not introduce
and naming conventions date to help developers strategies help manage new bugs and allows you to
make the codebase more understand the code's code changes effectively. refactor with confidence.
readable and maintainable. purpose and usage.
What are Software Architecture and
Patterns
What are Design Patterns and their
Types
Learn about Code Reusability and
Maintainability