Software Design Principles: Module-4
Software Design Principles: Module-4
Software Design Principles: Module-4
Problem Partitioning
For software design, the goal is to divide the problem into manageable pieces.
These pieces cannot be entirely independent of each other as they together form the system.
They have to cooperate and communicate to solve the problem. This communication adds
complexity.
Abstraction
Functional Abstraction
i. A module is specified by the method it performs.
ii. The details of the algorithm to accomplish the functions are not visible to the user of the
function.
Functional abstraction forms the basis for Function oriented design approaches.
Data Abstraction
Details of the data elements are not visible to the users of data. Data Abstraction forms
the basis for Object Oriented design approaches.
Modularity
Advantages of Modularity
Disadvantages of Modularity
Modular Design
1. Functional Independence:
2. Information hiding
Strategy of Design
To design a system, there are two possible approaches:
1. Top-down Approach
1. Correctness:
A good design should be correct i.e. it should correctly implement all
the functionalities of the system.
2. Efficiency:
A good software design should address the resources, time, and cost
optimization issues.
3. Understandability:
A good design should be easily understandable, for which it should be
modular and all the modules are arranged in layers.
4. Completeness:
The design should have all the components like data structures,
modules, and external interfaces, etc.
5. Maintainability:
A good software design should be easily amenable to change
whenever a change request is made from the customer side.
The software design concept simply means the idea or principle behind the design.
There are many concepts of software design and some of them are given below:
The following points should be considered while designing Software:
1. Abstraction- hide Irrelevant data
2. Modularity- subdivide the system
3. Architecture- design a structure of something
4. Refinement- removes impurities
5. Pattern- a repeated form
6. Information Hiding- hide the information
1. Architectural Design:
The architecture of a system can be viewed as the overall structure of
the system & the way in which structure provides conceptual integrity
of the system. The architectural design identifies the software as a
system with many components interacting with each other. At this
level, the designers get the idea of the proposed solution domain.
3. Detailed design:
Once the high-level design is complete, a detailed design is
undertaken. In detailed design, each module is examined carefully to
design the data structure and algorithms. The stage outcome is
documented in the form of a module specification document.
Effective Modular Design in Software
Engineering
Every software design should follow modularity.
Cohesion:
Cohesion is a measure of strength in relationship between various functions
within a module.
It is of 7 types which are listed below in the order of high to low cohesion:
1. Functional cohesion
2. Sequential cohesion
3. Communicational cohesion
4. Procedural cohesion
5. Temporal cohesion
6. Logical cohesion
7. Co-incidental cohesion
Coupling:
Coupling is a measure of strength in relationship between various modules
within a software.
It is of 6 types which are listed below in the order of low to high coupling:
1. Data Coupling
2. Stamp Coupling
3. Control Coupling
4. External Coupling
5. Common Coupling
6. Content Coupling
A good software design requires high cohesion and low coupling.
In this case, modules are subordinates to different modules. Therefore, no direct coupling.
2. Data Coupling: When data of one module is passed to another module, this is called
data coupling.
3. Stamp Coupling: Two modules are stamp coupled if they communicate using
composite data items such as structure, objects, etc. When the module passes non-global
data structure or entire structure to another module, they are said to be stamp coupled.
For example, passing structure variable in C or object in C++ language to a module.
4. Control Coupling: Control Coupling exists among two modules if data from one
module is used to direct the structure of instruction execution in another.
5. External Coupling: External Coupling arises when two modules share an externally
imposed data format, communication protocols, or device interface. This is related to
communication to external tools and devices.
6. Common Coupling: Two modules are common coupled if they share information
through some global data items.
7. Content Coupling: Content Coupling exists among two modules if they share code,
e.g., a branch from one module into another module.
Module Cohesion
In computer programming, cohesion defines to the degree to which the elements of a
module belong together.
5. Layered architecture:
• A number of different layers are defined with each layer
performing a well-defined set of operations. Each layer will
do some operations that becomes closer to machine
instruction set progressively.
• At the outer layer, components will receive the user interface
operations and at the inner layers, components will perform
the operating system interfacing(communication and
coordination with OS)
• Intermediate layers to utility services and application software
functions.