FSE Chap 4
FSE Chap 4
Chapter Four
Software Design
School of Computing
Department of Software Enginnering
December 28, 2024
1
Software Design
The design is the blueprint of the system to be
implemented in order to produce quality
software
Software design involves a set of principles,
concepts
and practices that lead to the development of
high quality software
For design, software engineers are looking
more at the solution domain (rather than the
problem domain when doing requirements)
The output is models that are used for
system 2
Relation of Software architecture to other
development tasks
Requiremen Hardware
ts, desired Architecture
qualities Hardware
Domain Analysis,
requirements Software Architectur
Analysis and risk architecture
e Design
analysis Modification design Modification
s to to hardware
requirement
s
Software Implementatio
architecture n constraints
Detailed Design,
Coding,
Integration,
Testing Development
tasks
Move
forward
feedback
3
4 + 1 view model of software architecture
7
Cont.…
Architectural Design - focuses on defining the overall
structure and organization of a software system, including
the major components, their interactions, and the system's
high-level behavior. It determines the system's
architecture, which serves as a blueprint for the
implementation
An example of architectural design is the Model-View-
Controller (MVC) pattern commonly used in web
applications. In MVC, the architectural design separates
the application into three main components: the Model
(represents the data and business logic), the View (handles
the user interface), and the Controller (manages the flow of
data between the Model and View).
Data/class Design - Data or class design focuses on the
internal structure of individual classes and the
relationships between them. It involves designing the data
models and class hierarchies, determining the attributes
and methods of each class, and defining how they interact
with each other. For example, in an e-commerce system,
data design may involve creating classes such as "Product,"
"Order," and "Customer," along with their respective 8
Cont.…
Interface Design - describes how the software elements,
hardware elements, and end-users communicate with one
another,
focuses on defining the interfaces or contracts
between different components or modules of a
system. It specifies how different parts of the
system will interact and communicate with each
other. Interface design ensures that components
can be developed independently, as long as they
adhere to the agreed-upon interfaces. For
example, in a messaging application, interface
design defines the methods and parameters
required for sending and receiving messages
between users or groups. It ensures that the
messaging functionality can be implemented and
integrated seamlessly across different modules.
9
Cont.…
Component-level Design –
component is self contained re usable unit of software
Component design focuses on designing the
internal structure and behavior of individual
components within a system. It involves breaking
down larger modules or subsystems into smaller,
reusable components and designing their internal
structure and interfaces. Component design
ensures that each component is self-contained,
encapsulating a specific functionality or
responsibility. For example, in a content
management system, component design may
involve designing components such as "User
Management," "Content Publishing," and "Search
Engine," each responsible for a specific aspect of
the system's functionality.
10
The Design Process
The design is the blueprint of the system to
be
implemented in order to produce quality
software
• The quality guidelines used are:
The design must implement all of the explicit
requirements contained in the analysis model,
and it must accommodate all of the implicit
requirements desired by the customer.
The design must be a readable, understandable
guide for those who generate code and for those
who test and subsequently support the software.
The design should provide a complete picture
of the software, addressing the data, functional,
and behavioral domains from an implementation
perspective.
11
General Model of the Design Process
12
Software architecture
A software architecture refers to the high-level
structure and organization of a software system. It
involves making design decisions that determine how
various components of a system will interact and work
together to achieve the desired functionality and
quality attributes.
The software architecture of a web-based e-commerce
application typically involves multiple layers or tiers,
each responsible for different aspects of the system's
functionality. Let's consider a three-tier architecture,
which consists of the presentation layer, the application
layer, and the data layer.
18
Software architecture
Presentation Layer: The presentation layer is
responsible for the user interface and handling user
interactions.
Application Layer: The application layer contains the
business logic of the e-commerce application. It
handles user requests, processes data, and coordinates
the interaction between the presentation layer and the
data layer.
Data Layer: The data layer is responsible for
managing the storage and retrieval of data required by
the e-commerce application. It includes databases, file
systems, or other persistent storage mechanisms
19
Software architecture
Some of architectural style
1. Repository architecture: An architecture where
subsystems access and modify data from a single data
structure called the central repository.
Control flow can be dictated either by the central repository
The repository architecture is typical for database
management systems, such as a payroll system or a bank
system.
20
Cont…
2. Model/View/Controller:
In the Model/View/Controller (MVC) architecture subsystems are
classified into three different types:
1. model subsystems are responsible for maintaining
domain knowledge,
It is developed such that they do not depend on any
21
Cont…
3. Client/server architecture
In the client/server architecture a subsystem, the server,
provides services to instances of other subsystems
called the clients, which are responsible for interacting
with the user.
The request for a service is usually done via a remote
procedure call mechanism or a common object broker.
The client/server architecture is a generalization of the
repository architecture.
27
System Design
28
From Analysis to System Design
29
Design Goal
30
Relationship Between Design Goals
31
Typical Design Trade-offs
Functionality vs. Usability
Cost vs. Robustness
Efficiency vs. Portability
Rapid development vs. Functionality
Cost vs. Reusability
Backward Compatibility vs. Readability
32
Typical Design Trade-offs
In system design, trade-offs refer to the
compromises that need to be made when making
design decisions. These trade-offs involve making
choices between different factors or attributes of
a system, where improving one aspect may come
at the cost of another. Here are some examples of
Performance vs. Scalability: Increasing
performance often involves optimizing the system
for speed and efficiency. However, this may limit
its scalability, i.e., the ability to handle increasing
workloads or accommodate a growing number of
users. Balancing performance and scalability
requires careful consideration of factors like
hardware resources, caching strategies, and
distributed computing techniques. 33
Typical Design Trade-offs
Flexibility vs. Complexity: Building a highly flexible
system that can adapt to changing requirements typically
involves introducing more complexity. Adding flexibility
may require incorporating abstractions, configuration
options, or customizable features, which can make the
system harder to understand, maintain, or troubleshoot.
Striking the right balance between flexibility and simplicity
is crucial to avoid excessive complexity.
36
Cont.
Service is specified by Subsystem interface:
Specifies interaction and information flow
from/to subsystem boundaries, but not inside
the subsystem.
Should be well-defined and small.
Often called API: Application programmer’s
interface, but this term should used during
implementation, not during System Design
37
Structural Decomposition
Structural decomposition, also known as
architectural decomposition, is a process in
system design where a complex system is
broken down into smaller, more manageable
components or modules. It involves dividing
the system's functionality, responsibilities,
and interactions into cohesive and loosely
coupled parts, creating a hierarchical
structure.
39
Coupling and Cohesion
♦ Goal: Reduction of complexity while change
occurs
♦ Cohesion measures the dependence among
classes
High cohesion: The classes in the subsystem
perform similar tasks and are related to each
other (via associations)
Low cohesion: Lots of miscellaneous and
auxiliary classes, no associations
40
Cont.
♦ Coupling measures dependencies between
subsystems
High coupling: Changes to one subsystem will
have high impact on the other subsystem
(change of model, massive recompilation, etc.)
Low coupling: A change in one subsystem does
not affect any other subsystem
♦ Subsystems should have a maximum
cohesion and minimum coupling as possible:
How can we achieve high cohesion?
How can we achieve loose coupling? 41
Decomposition Guidelines
The aim of the design process is to identify
loosely coupled, highly cohesive functions.
Each function should therefore do one thing
and one thing only
Cohesion – the degree to which a module
performs one and only one function.
Coupling – the degree to which a module is
connected to other modules in the system.
42
Coupling and Cohesion
43
Detailed Design
Concerned with producing a short design
specification (minispec) of each function. This
should describe the processing, inputs and
outputs
These descriptions should be managed in a
data dictionary
From these descriptions, detailed design
descriptions, expressed in a PDL or
programming language, can be produced
44
Object Oriented Design
System design activities: From objects to subsystems
Outline
45
Object Oriented Design
Object-oriented design (OOD) is a software design paradigm
that focuses on creating software systems by modeling
them as a collection of objects that interact with each
other.
OOD promotes modular design, code reusability, and
maintainability, making it a popular approach in modern
software development.
Key Concepts in Object-Oriented Design:
Objects: Objects are instances of classes that encapsulate data
and behavior. They represent real-world entities or abstract
concepts and interact with each other through messages.
Classes: Classes are blueprints or templates for creating objects.
They define the attributes (data) and methods (behavior) that
objects of that class will possess. Classes provide a way to define
common characteristics and behavior for a set of objects.
46
Encapsulation: Encapsulation is the
practice of bundling data and methods
together within a class. It hides the internal
details of an object and provides a well-
defined interface for interacting with it.
Encapsulation helps achieve data abstraction
and improves code maintainability and
reusability.
Inheritance: Inheritance allows classes to
inherit attributes and methods from other
classes, forming a hierarchical relationship. It
facilitates code reuse by enabling the
creation of specialized classes (subclasses)
that inherit common features from a more
general class (superclass). Subclasses can 47
1. Identifying Design Goals
Is the first step of system design, It identifies the qualities
that our system should focus on; which are mostly inferred from
the nonfunctional requirements or from the application
domain.
Example: considering the nonfunctional requirements for
MyTrip
Design goals for MyTrip
Reliability: MyTrip should be reliable [generalization of
nonfunctional requirement 2].
Fault Tolerance: MyTrip should be fault tolerant to loss of
connectivity with the routing service [rephrased nonfunctional
requirement 2].
Security: MyTrip should be secure, i.e., not allow other drivers
or nonauthorized users to access another driver’s trips
[deduced from application domain].
Modifiability: MyTrip should be modifiable to use different
routing services [anticipation of change by developers]. 48
Cont…
list a number of possible design criteria.
1. Performance
2. dependability
3. cost
4. maintenance and
5. end user criteria.
1. Performance criteria: include the speed and space
requirements imposed on the system.
49
Cont..
2. Dependability criteria: determine how much effort
should be expended in minimizing system crashes and their
consequences. How often can the system crash? How available
to the user should the system be? Are there safety issues
associated with system crashes? Are there security risks
associated with the system environment?
50
Cont…
3. Cost criteria: include the cost to develop the
system, to deploy it, and to administer it.
51
Cont…
4. Maintenance criteria: determine how difficult it is to
change the system after deployment. How easily can new
functionality be added? How easily can existing functions be
revised? Can the system be adapted to a different
application domain? How much effort will be required to port
the system to a different platform?
52
Cont…
5. End user criteria: include qualities that are desirable
from a users’ point of view that have not yet been covered
under the performance and dependability criteria.
56
3. Mapping subsystems to processors and components
Mapping subsystems to processors and components
involves assigning the identified subsystems of a
system to specific hardware processors or software
components. This mapping is done to optimize
performance, distribute workload, and ensure efficient
utilization of resources. Let's consider an example to
illustrate this mapping process:
60
Cont…
61
Cont…
62
Example In MyTrip
Example In MyTrip, we deduce from the requirements that
PlanningSubsystem and RoutingSubsystem run on two different
nodes:
In the MyTrip subsystem We select a Unix machine as the
virtual machine for the :WebServer and the Web browsers on
onboard computer
FIG. Revised design model for MyTrip (UML Class diagram, associations 64
4. Defining Persistent Data Stores
Where and how data is stored in the system impacts
the system decomposition.
69
Cont…
An access matrix only represents static access control. This
means that access rights can be modeled as attributes of the
objects of the system.
In a model if the access rights is allocated dynamically in the
system, this type of access is called dynamic access control.
71
6. Designing the global control flow
Designing the global control flow in system design
involves planning and organizing the sequence of
operations and interactions between various
components and modules of the system. It defines
the overall structure and flow of execution within
the system. Here are some key considerations for
designing the global control flow:
76
Thank You!
Q?
77