Se Unit-3
Se Unit-3
Software Design
Software design is a phase that comes after the requirement analysis of the software. In
this phase, the requirements of the software are represented in a form that is suitable as
per the customer’s demand, and that can easily be implemented through any coding
language by the software developers.
The software design is like a blueprint of the software. This can be related to the
construction of a building. Before constructing any building, a blueprint of that building
is created and according to that blueprint, further construction is carried out. For a similar
purpose, in the case of software development, we make software design. After the design
phase, the software undergoes the coding and implementation phase. In this phase,
different developers work on different modules. So, for any kind of reference or any help,
they refer to this software design.
The design phase of software development deals with transforming the customer
requirements as described in the SRS documents into a form implementable using a
programming language.
Generally, there are 3 major activities in Software Design –
1. External Design
2. Architectural Design
3. Detailed Design
The Architectural design and Detailed design are collectively known as Internal Design.
External Design – External design involves conceiving, planning out and
specifying the externally observable characteristics of Software Product such as
User interface, report formats, data sources, functional characteristics and
performance requirements.
Internal Design – Internal design involves conceiving, planning out and specifying
the internal structure and processing details of the software product. The goals of
1
internal design are to specify internal structure and processing details, to record
design, to elaborate the test plan and to provide alternatives, provide the blueprint
design for implementation, specifying using and maintenance activities.
Architectural Design – Architectural Design involves the refining of the conceptual
view of the system, identifying data entities, attributes, internal processing flows and
their relationships.
Detailed Design – Detailed design include specifications of algorithms/activity flows and
detailed class diagrams that provide detailed blueprints for concrete implementation of
data models/objects and their interrelationships.
2
Elements of a System
1. Architecture: This is the conceptual model that defines the structure, behavior,
and views of a system. We can use flowcharts to represent and illustrate the
architecture.
2. Modules: These are components that handle one specific task in a system. A
combination of the modules makes up the system.
3. Components: This provides a particular function or group of related functions.
They are made up of modules.
4. Interfaces: This is the shared boundary across which the components of a system
exchange information and relate.
5. Data: This is the management of the information and data flow.
3
1. Abstraction: One of the fundamental concepts of object-oriented programming
(OOP) languages is an abstraction. Its primary purpose is to deal with complexity by
concealing internal details from the user. This allows the user to build more complicated
logic on top of the offered abstraction without having to understand or even consider all
the hidden complexity.
2. Modularity: Modularity refers to breaking a system or project into smaller sections
to lessen the system's or project's complexity. Similarly, modularity in design refers to the
division of a system into smaller elements that can be built independently and then used
in multiple systems to execute different purposes. Sometimes to deal with Monolithic
software, which is difficult to grasp for software engineers, it is required to partition the
software into components known as modules. As a result, modularity in design has
become a trend that is also essential.
3. Architecture: A system's software architecture represents the design decisions linked
to the general structure and behavior of the system. Architecture assists stakeholders in
comprehending and analyzing how the system will attain critical characteristics such as
modifiability, availability, and security. It specifies how components of a software
system are constructed, as well as their relationships and communication. It acts as a
software application blueprint and a development foundation for the developer team.
4. Refinement: Refinement means removing any impurities and improving the quality
of something. The software design refinement idea is a process of building or presenting
4
the software or system in a detailed manner, which implies elaborating on a system or
software. In addition, refinement is essential for identifying and correcting any possible
errors.
5. Design Patterns: A Software Design Pattern is a general, reusable solution to a
commonly occurring problem within a given context in software design. They are
templates to solve common software engineering problems, representing some of the
finest practices experienced object-oriented software engineers utilize. A design pattern
systematically describes and explains a general design that handles a recurring design
challenge in object-oriented systems. It discusses the problem, the remedy, when to use
it, and the repercussions. It also provides implementation guidance and examples.
6. Information/Data Hiding: Simply put, information hiding implies concealing
information so that an unauthorized entity cannot access it. In software design,
information hiding is accomplished by creating modules in such a way that information
acquired or contained in one module is concealed and cannot be accessible by other
modules.
7. Refactoring: Refactoring is the process of reorganizing code without affecting its
original functionality. Refactoring aims to improve internal code by making modest
changes that do not affect the code's exterior behavior. Computer programmers and
software developers refactor code to improve the software's design, structure, and
implementation. As a result, Refactoring increases code readability while decreasing
complications. Refactoring can also assist software engineers in locating faults or
vulnerabilities in their code.
5
reaching a stage in which the design seems to fulfill all the customer requirements, a set
of trained software designers make the final design of the software.
2) Detailed Design: The final design that is made at the end of the preliminary design
phase is called the detailed design. After this design is made, no further changes are made
in the design of the software, and the design is sent to the development team for further
work.
The design phase of the software is very crucial in the software development process.
This is because if the design of the software is not accurate to fulfill all the requirements
of the user, then the software that will be developed will also look those things because
the software will follow the design only. So, for making good quality software, the design
of the software should also be proper and accurate. So, each design in the preliminary
stage must be evaluated in every manner before being finalized as the design for the
software.
3 Software Design Levels
1) Architectural Design
2) Preliminary (High-Level) Design
3) Detailed Design
1) Architectural Design: The architectural design is the highest summarize
(abstract) version of the system. It identifies the software as a system with many
components interacting with each other. At this level, the designers get the idea of
proposed solution domain.
2) Preliminary (High-Level) Design: High-level design means identification of
different modules and the control relationships among them and the definition of the
interfaces among these modules. The outcome of the high-level design is called software
architecture or the program structure. Many different types of notations have been used
to represent a high-level design. A popular way is to use a tree-like diagram called the
Structure Chart to represent the control hierarchy in the high-level design.
3) Detailed Design: In this level of software design, the data structures and
algorithms are designed for different modules. Thus at this stage, the design includes
principal components (also called modules or sub-systems), relationships between them,
6
and how they are distributed along with the data structures and algorithms. The outcome
in this stage is also known as the module specification document.
7
would be easy for the developers to implement it and build the same software that is
represented in the design.
3) Efficiency: The software design must be efficient. The efficiency of the software
can be estimated from the design phase itself, because if the design is describing software
that is not efficient and useful, then the developed software would also stand on the same
level of efficiency. Hence, for efficient and good quality software to be developed, care
must be taken in the designing phase itself.
4) Maintainability: The software design must be in such a way that modifications
can be easily made in it. This is because every software needs time to time modifications
and maintenance. So, the design of the software must also be able to bear such changes. It
should not be the case that after making some modifications the other features of the
software start misbehaving. Any change made in the software design must not affect the
other available features, and if the features are getting affected, then they must be handled
properly.
8
Software design documents break down nearly every aspect of a software development
project: What problem will the software solve? What will the final product look like?
How does the internal architecture function? When you create your SDD, you'll plan all
these factors in advance.
9
An overview of what's in the document
Any important background information
2. System architecture: The system architecture section is a crucial part of a
software design document. It describes the overall structure of the software system,
including its major components and subsystems and how they relate to each other. This
section shows how different system parts work together to achieve the desired
functionality.
Key elements to include in the system architecture section are:
A high-level diagram of the architecture
Description of major components and what they do
Explanation of design patterns and architectural styles used
Discussion of important design decisions and trade-offs
3. Data design: The data design section focuses on how the software system stores,
manages, and processes information, including details about the database structure, data
models, and data processing techniques.
Essential aspects to cover in the data design section include:
Database structure and table layouts
Data flow diagrams
Data validation and integrity rules
How data will be stored and retrieved
4. Interface design : The interface design section describes how different parts of the
system will communicate with each other and interact with external systems or services.
This includes both internal interfaces between modules and external APIs or integration
points.
Key elements to include in the interface design section are:
API specifications and protocols
Message formats and data structures
How errors and exceptions will be handled
Security and authentication methods
10
5. Component design : The component design section provides detailed information
about individual modules or components within the system. This includes their specific
functionality, what inputs they need and outputs they produce, and any algorithms or data
structures they use.
For each major component, consider including:
Purpose and responsibilities
Input and output specifications
Algorithms and processing logic
Dependencies on other components or external systems
6. User interface design : The user interface design section focuses on how users
interact with the software system. This includes details about the user interface's layout,
navigation, functionality, and specific design considerations or usability requirements.
Key elements to include in this section are:
Wireframes or mockups of key screens
Description of user workflows and interactions
Accessibility considerations
7. Assumptions and dependencies: This section outlines any assumptions made
during the design process and any external dependencies or constraints that may impact
the system's implementation.
Consider including:
Technical assumptions about the development environment
Dependencies on external libraries or services
Constraints related to hardware, software, or infrastructure
Any regulatory or compliance requirements
8. Glossary of terms: A glossary of terms is essential to any software design
document, especially for complex systemas or those with industry-specific terminology.
This section should provide clear definitions for:
Technical terms
Acronyms
Jargon
11
To create an effective software design document, consider these best practices:
Use clear, simple language: Avoid jargon and overly technical terms when
possible. When technical language is necessary, explain clearly or include
definitions in the glossary.
Include visuals: Use diagrams, flowcharts, and other visual aids to illustrate
complex concepts and relationships between components.
Be consistent: Use the same formatting, terminology, and structure throughout
the document to make it easier to read and understand.
Keep it current: Regularly review and update the design document as the project
evolves to ensure accuracy.
Make it easy to access: Store the document in a central location where all team
members can easily find and reference it.
Encourage teamwork: Use tools that support collaboration with editing and
commenting to make it easy for team members to provide input and discuss ideas.
This promotes knowledge sharing across the team, ensuring that insights and
expertise are distributed effectively throughout the project lifecycle.
Consider future growth: Consider how the system might need to expand or
change and design with flexibility.
Include traceability: Improve the design decision-making process by
establishing clear links between requirements, design choices, and
implementation details. This can help you understand why specific decisions were
made.
12
3. New Person can also work on the project: New person to the project can very easily
understand the project through documentations and start working on it. So, developers
need to maintain the documentation and keep upgrading it according to the changes made
in the product/software.
4. Everything is well Stated: This documentation is helpful to understand each and
every working of the product. It explains each and every feature of the product/software.
5. Proper Communication: Through documentation, we have good communication with
every member who is part of the project/software. Helpful in understanding role and
contribution of each and every member
Modularity
The module simply means the software components that are been created by dividing the
software. The software is divided into various components that work together to form a
single functioning item but sometimes they can perform as a complete function if not
connected with each other. This process of creating software modules is known as
Modularity in software engineering. It simply measures the degree to which these
components are made up than can be combined. Some of the projects or software designs
are very complex that it’s not easy to understand its working and functioning. In such
cases, modularity is a key weapon that helps in reducing the complexity of such software
or projects.
Example
Consider a web application with modules for user authentication, data management, and
user interface components. Each module handles distinct aspects of the application and
communicates with the others through predefined interfaces. This way, changes to the
data management logic, for example, do not affect user authentication or interface
modules, assuming the interface remains consistent.
Benefits of Modularity
1. Maintainability: Changes in one module typically do not affect others, making bugs
easier to track down and fix without risking other parts of the system.
2. Reusability: Modules designed for one project can often be used in another, saving
development time and reducing errors by reusing proven code.
13
3. Scalability: Modular systems can be scaled more readily by adding new modules or
enhancing existing ones without impacting the rest of the system.
4. Parallel Development: Different teams can work on different modules
simultaneously, decreasing development time.
5. Simplicity: Modularity divides complex issues into smaller, more manageable
components, making them less overwhelming. Complex problems may be intimidating.
The software's structure has been simplified, making it simpler to comprehend, create,
and maintain.
6. Testing: It also allows for more focused and effective testing of modules at an
individual level. Issues that must be addressed should be identified early in development
to ensure a higher-quality final product.
14
Collaboration: allows teams to operate independently on various modules, which
promotes parallel development.
Testing: Modular systems are easier to test as each module can be tested
separately, promoting robustness.
Documentation: Encourages better documentation practices as module interfaces
need to be well-defined and documented.
Interchangeability: Modules can be swapped or upgraded without affecting the
overall system functionality, promoting interoperability.
15
Real-World Example of Interface
.USB (Universal Serial Bus) standard. USB defines a set of protocols and
specifications for communication between devices and a host controller
The interface specification, or USB standard, specifies the guidelines and procedures
that devices must adhere to in order to connect with one another.
Various devices such as keyboards, mice, printers, cameras, and storage devices
implement this interface specification.
Every gadget complies with the USB standard, guaranteeing compatibility and
interoperability with other gadgets that share that standard.
Regardless of the particular features or manufacturer of any device, the host
controller (such as a computer or smartphone) communicates with these devices
over the universal interface offered by the USB standard.
This abstraction allows the host controller to communicate with a wide range of
devices without needing to know the intricate details of each device’s
implementation.
16
Interfaces play a crucial role in achieving loose coupling by defining well-
defined points of interaction between modules. This allows modules to
communicate with each other based on contracts defined by interfaces.
3. Flexibility and Reusability:
Interfaces enable polymorphism, allowing different modules to be substituted or
replaced with alternative implementations as long as they adhere to the same
interface.
Modularity further enhances this flexibility by allowing modules to be
developed, tested, and maintained independently, facilitating easier integration
and evolution of the system over time.
4. Standardization and Documentation:
Interfaces serve as standardized communication channels between modules,
providing clear documentation of the expected behavior and interactions.
Modularity, by breaking down the system into modular components, facilitates
the organization and management of these interfaces, making it easier for
developers to understand and work with the system.
Scalability:
Software systems’ scalability is supported by both interfaces and modularity.
By adding or changing modules, modularity enables the gradual evolution
and inclusion of new functionalities.
As long as they follow the defined interface contracts, interfaces guarantee
that new modules can be easily integrated with preexisting ones, allowing
the system to expand and change to meet evolving needs without
compromising its overall architecture.
17
Coupling and Cohesion
Coupling and Cohesion are two key concepts in software engineering that are used to
measure the quality of a software system’s design. Both coupling and cohesion are
important factors in determining the maintainability, scalability, and reliability of a
software systems.
Coupling represents the relationships between modules, and cohesion defines the
relationships within them.
What is Coupling and Cohesion?
A) Coupling refers to the degree of interdependence between software modules. High
coupling means that modules are closely connected and changes in one module may
affect other modules. Low coupling means that modules are independent, and changes in
one module have little impact on other modules.
Coupling is the measure of the degree of interdependence between the modules. A good
software will have low coupling.
18
Types of Coupling:
1. Data Coupling: When data of one module is passed to another module, this is
called data coupling. Each module maintains its own data and does not exactly access or
modify the data of other modules
19
2. Stamp Coupling : In stamp coupling, the complete data structure is passed from
one module to another module. Modules share a composite data structure such as a record
or object without sharing. Changes to the structure can affect several modules, but the
connection is weaker than in the content connection.
3 . Control Coupling: Control coupling is one of the types of coupling in software
engineering occurs when one module controls the behavior of another module. This type
of coupling implies that one module has knowledge of internal workings & decisions or
another module, that makes the code more difficult to maintain.
4. External Coupling: In external coupling, the modules depend on other modules,
external to the software being developed or to a particular type of hardware. Ex- protocol,
external file, device format, etc.
5. Common Coupling: Common coupling occurs when two or more modules in the
system share global data. The modules can access & manipulate the same global
variables & the data structures. The changes in global data mean tracing back to all
modules which access that data to evaluate the effect of the change. So it has got
disadvantages like difficulty in reusing modules, reduced ability to control data accesses,
and reduced maintainability.
6. Content Coupling: In a content coupling, one module can modify the data of another
module, or control flow is passed from one module to the other module. This is the worst
form of coupling and should be avoided.
B. Cohesion refers to the degree to which elements within a module work together to
fulfill a single, well-defined purpose. High cohesion means that elements are closely
related and focused on a single purpose, while low cohesion means that elements are
loosely related and serve multiple purposes.
20
Types of Cohesion
21
The elements within the module work together by passing data to each other. It is weaker
than sequential cohesion. Like, usage of a customer account number, finding the name of
the customer, the loan balance of the customer, etc.
4. Procedural Cohesion: Procedural cohesion occurs when the elements within a
module are grouped based on a specific sequence of actions or steps. This type of
cohesion is weaker than the communicational cohesion.
Examples - Read, write, edit of the module, zero padding to the numeric fields, returning
records, etc.
5. Temporal Cohesion: Temporal cohesion occurs when the elements within a
module are executed at the same time or within the same timeframe. It is considered
weaker than the procedural cohesion.
Examples - Setting the counter to zero, opening the student file, clearing the variables of
error messages, initializing the array, etc.
6. Logical Cohesion: Logical cohesion occurs when the elements within a module
are logically related, but do not fit into any other cohesion types. It is not strong as other
cohesion types.
Examples - When a component reads inputs from tape, disk, and network, etc.
7. Coincidental Cohesion: Coincidental cohesion occurs when the elements are not
related to each other.
Examples - Module for miscellaneous functions, customer record usage, displaying of
customer records, calculation of total sales, and reading the transaction record, etc.
22
Advantages of high cohesion
1. Improved readability and understandability: High cohesion results in clear, focused
modules with a single, well-defined purpose, making it easier for developers to
understand the code and make changes.
2. Better error isolation: High cohesion reduces the likelihood that a change in one part
of a module will affect other parts, making it easier to
3. Improved reliability: High cohesion leads to modules that are less prone to errors and
that function more consistently, leading to an overall improvement in the reliability of
the system.
23
Explanation
High Cohesion: User Module: The User Module is designed to handle all user-
related functionalities:
Attributes: It has attributes like id, name, and email.
Functions: It includes functions such as register(), login(), and logout().
Why is it high cohesion?
Single Purpose: All the functions in the User Module are related to managing users.
This means everything in this module is focused on one specific task – handling
user operations.
Low Coupling: Book and Member Modules: The Library System consists of two
separate modules: Book and Member.
Book Module:
Attributes: It has attributes like title and author.
Functions: It includes functions such as addBook() and removeBook().
Member Module:
o Attributes: It has attributes like memberId and memberName.
o Functions: It includes functions such as addMember() and
removeMember().
24
Differences between Coupling and Cohesion
Aspect Cohesion Coupling
25
TOP-DOWN AND BOTTOM-UP APPROACH
What is Top-Down Approach?
Top-Down Approach is an approach to design algorithms in which a bigger problem is
broken down into smaller parts. Thus, it uses the decomposition approach. This approach
is generally used by structured programming languages such as C, COBOL,FORTRAN.
The top-down approach, also known as the “divide and conquer” approach.
26
Disadvantages of Top-Down Approach
Specification tends to change over time and in a top-down approach, all decisions
made from the beginning of the project depend directly or indirectly on the high-
level specification.
In Dynamic Programming, the top-down approach is slow as compared to the
bottom-up approach, as it involves recursion.
There is a chance of stack overflow here.
It takes more memory space as it involves recursion.
27
Advantages of Bottom-Up Approach
Test conditions are easier to create.
Observation of test results is easier.
Contains less redundancy due to the presence of data encapsulation and data-
hiding.
Reusability of the code.
28
Decomposition approach is used Composition approach is used here.
5.
here.
29
2. Design Phase: It uses Structure Chart and Pseudo Code.
1. Analysis Phase: : Analysis Phase involves data flow diagram, data dictionary, state
transition diagram, and entity-relationship diagram.
1) Data Flow Diagram: In the data flow diagram, the model describes how the data
flows through the system. We can incorporate the Boolean operators and & or link data
flow when more than one data flow may be input or output from a process.
For example, if we have to choose between two paths of a process we can add an operator
or and if two data flows are necessary for a process we can add an operator. The input of
the process “check-order” needs the credit information and order information whereas the
output of the process would be a cash-order or a good-credit-order.
2) Data Dictionary: The content that is not described in the DFD is described in the data
dictionary. It defines the data store and relevant meaning. A physical data dictionary for
data elements that flow between processes, between entities, and between processes and
entities may be included. This would also include descriptions of data elements that flow
external to the data stores.
A logical data dictionary may also be included for each such data element. All system
names, whether they are names of entities, types, relations, attributes, or services, should
be entered in the dictionary.
3) State Transition Diagram: State transition diagram is similar to the dynamic model.
It specifies how much time the function will take to execute and data access triggered by
events. It also describes all of the states that an object can have, the events under which
an object changes state, the conditions that must be fulfilled before the transition will
occur and the activities were undertaken during the life of an object.
30
Structured Analysis
Structured Analysis is a development method that allows the analyst to understand the
system and its activities in a logical way.
It is a systematic approach, which uses graphical tools that analyze and refine the
objectives of an existing system and develop a new system specification which can be
easily understandable by user.
It has following attributes −
It is graphic which specifies the presentation of application.
It divides the processes so that it gives a clear picture of system flow.
It is logical rather than physical i.e., the elements of system do not depend on
vendor or hardware.
It is an approach that works from high-level overviews to lower-level details.
31
1. DFD : It is a technique developed by Larry Constantine to express the requirements
of system in a graphical form. In the data flow diagram, the model describes how the data
flows through the system.
It gives an overview of what data a system processes, what transformations are
performed, what data are stored, what results are produced and where they flow.
Its graphical nature makes it a good communication tool between user and analyst or
analyst and system designer.
Basic Elements of DFD: DFD is easy to understand and quite effective when the
required design is not clear and the user wants a notational language for communication.
However, it requires a large number of iterations for obtaining the most accurate and
complete solution.
The following table shows the symbols used in designing a DFD and their significance −
Types of DFD: DFDs are of two types: Physical DFD and Logical DFD.
Physical DFD Logical DFD
It is implementation dependent. It shows It is implementation independent. It focuses
which functions are performed. only on the flow of data between processes.
It provides low level details of hardware, It explains events of systems and data
software, files, and people. required by each event.
It depicts how the current system operates It shows how business operates; not how the
and how a system will be implemented. system can be implemented.
32
Context Diagram: A context diagram helps in understanding the entire system
by one DFD which gives the overview of a system. It starts with mentioning major
processes with little details and then goes onto giving more details of the
processes with the top-down approach.
The context diagram of mess management is shown below.
33
communication. A decision tree is a diagram that shows alternative actions and
conditions within horizontal tree framework. Thus, it depicts which conditions to
consider first, second, and so on.
Decision trees depict the relationship of each condition and their permissible actions. A
square node indicates an action and a circle indicates a condition. It forces analysts to
consider the sequence of decisions and identifies the actual decision that must be made.
The major limitation of a decision tree is that it lacks information in its format to describe
what other combinations of conditions you can take for testing. It is a single
representation of the relationships between conditions and actions.
34
4. Decision Tables: Decision tables are a method of describing the complex
logical relationship in a precise manner which is easily understandable.
It is useful in situations where the resulting actions depend on the occurrence of one
or several combinations of independent conditions.
It is a matrix containing row or columns for defining a problem and the actions.
The entries in decision table are given by Decision Rules which define the relationships
between combinations of conditions and courses of action. In rules section,
Y shows the existence of a condition.
N represents the condition, which is not satisfied.
A blank - against action states it is to be ignored.
35
X (or a check mark will do) against action states it is to be carried out.
For example, refer the following table −
CONDITIONS Rule 1 Rule 2 Rule 3 Rule 4
Advance payment
Y N N N
made
Purchase amount =
- Y Y N
Rs 10,000/-
Regular Customer - Y N -
ACTIONS
Give 5% discount X X - -
Give no discount - - X X
5. Structured English: Structured English is the use of the English language with the
syntax of structured programming to communicate the design of a computer program to
non-technical users by breaking it down into logical steps using straightforward English
words.
It is best used when sequences and loops in a program must be considered and the
problem needs sequences of actions with decisions.
It does not have strict syntax rule. It expresses all logic in terms of sequential
decision structures and iterations.
36
Advantages of Structured Analysis
1. Clear and straightforward: Structured Analysis is a clear and straightforward
methodology that is easy to understand and implement.
2. Top-down approach: The top-down approach of Structured Analysis makes it easy to
identify the high-level functions and processes involved in a software system, and to
break them down into smaller, more manageable components.
3. Emphasis on data: Structured Analysis places a strong emphasis on the data that a
software system manipulates, making it easier to understand the relationships between
data and processes.
4. Well-suited for small to medium-sized systems: Structured Analysis is well-suited
for small to medium-sized systems, where the focus is on breaking down complex
systems into simpler, more manageable components.
37
Structured Analysis Object-Oriented Analysis
designing, implementing, and supporting
an information system.
It is suitable for well-defined projects with It is suitable for large projects with changing
stable user requirements. user requirements.
Risk while using this analysis technique is Risk while using this analysis technique is
high and reusability is also low. low and reusability is also high.
Structuring requirements include DFDs Requirement engineering includes the Use
(Data Flow Diagram), Structured case model (find Use cases, Flow of events,
Analysis, ER (Entity Relationship) Activity Diagram), the Object model (find
diagram, CFD (Control Flow Diagram), Classes and class relations, Object
Data Dictionary, Decision table/tree, and interaction, Object to ER mapping),
the State transition diagram. Statechart Diagram, and deployment diagram.
This technique is old and is not preferred
This technique is new and is mostly preferred.
usually.
38
1. Steep learning curve: OOA can be more difficult to understand and implement than
Structured Analysis, especially for those who are not familiar with object-oriented
programming.
2. Bottom-up approach: The bottom-up approach of OOA can make it difficult to
understand the high-level functions and processes involved in a software system, and to
break them down into smaller, more manageable components.
3. Emphasis on objects: OOA places a strong emphasis on objects, making it more
difficult to understand the relationships between data and processes.
39
Function Oriented Design Strategies: Function Oriented Design Strategies
are as follows:
1) Data Flow Diagram (DFD): A data flow diagram (DFD) maps out the flow of
information for any process or system. It uses defined symbols like rectangles, circles and
arrows, plus short text labels, to show data inputs, outputs, storage points and the routes
between each destination.
2) Data Dictionaries: Data dictionaries are simply repositories to store information about
all data items defined in DFDs. At the requirement stage, data dictionaries contains data
items. Data dictionaries include Name of the item, Aliases (Other names for items),
40
Description / purpose, Related data items, Range of values, Data structure definition /
form.
3) Structure Charts: Structure chart is the hierarchical representation of system which
partitions the system into black boxes (functionality is known to users, but inner details
are unknown). Components are read from top to bottom and left to right. When a module
calls another, it views the called module as a black box, passing required parameters and
receiving results.
4) Pseudo Code: Pseudo Code is system description in short English like phrases
describing the function. It uses keyword and indentation. Pseudocodes are used as
replacement for flow charts. It decreases the amount of documentation required.
41
Example: Pseudo Code for the addition of two numbers
Step 1: Read A, B
Step 2: Compute C = A + B
Step 3: Print C
Step 4: Stop
42
Key Elements of OOD:
1. Objects: Objects are all the entities involved in the solution design. Persons, banks,
companies, and users are all examples of objects. Every object has some properties
associated with it, along with some methods for performing operations on those
attributes.
2) Class: Classes are generic descriptions of objects. An object is a class instance. A
class defines all the properties an object can have and the methods that represent the
object's functionality.
3) Messages: Objects communicate by passing messages. Messages contain the target
object's integrity, the name of the requested operation, and any other action required to
complete the function. Messages are frequently implemented through procedure or
function calls.
4) Abstraction: Abstraction is used in object-oriented design to deal with complexity.
Abstraction involves hiding the complex implementation details and showing only the
essential features of the object
Example: An Animal class can represent general properties and behaviors common to all
animals without detailing the specific implementation for each type of animal.
5) Encapsulation: It is also known as information concealing. Encapsulation is the
bundling of data (attributes) and methods (functions) that operate on the data into a single
43
unit called a class.Encapsulation not only groups together an object's vital information
but also restricts access to the data and operations from the outside world.
Example: Consider a Car class with private attributes speed and fuelLevel and public
methods accelerate(), brake(), and refuel(). The internal state of speed and fuelLevel can
only be modified through these methods, ensuring controlled access.
Example: A Vehicle class can be a parent class with common attributes like make and
model, and child classes like Car and Bike can inherit these attributes and have additional
specific properties
44
7) Polymorphism: OOD languages give a technique for assigning the same name to
methods that perform similar functions but differ in arguments. This is referred to as
polymorphism, and it allows a single interface to perform functions for multiple types.
The relevant piece of the code is run depending on how the service is invoked.
Example: Both Dog and Cat classes inherit from Animal and implement the
make_sound method. A function can take an Animal object and call make_sound,
regardless of whether it’s a Dog or Cat.
45
Here are some common UML diagrams and how they contribute to object-oriented
design:
Class Diagrams: These diagrams show the structure of a system by highlighting
the classes, their attributes, and relationships. This is useful in visualizing how
data and behaviors are organized, which is the foundation of object-oriented
design.
Sequence Diagrams: Sequence diagrams illustrate how objects in a system
interact over time. They show the flow of messages and actions, helping designers
see the order in which things happen. This makes it easier to understand the
dynamic behavior of a system.
State Diagrams: State diagrams represent the various states of an object and the
transitions between them. They help designers understand how objects respond to
different events, which is key for designing systems that change over time.
By using these diagrams, developers can make sure everyone has a clear picture of the
system’s structure and behavior, making it easier to collaborate and avoid
misunderstandings.
46
COMPARISON FUNCTION ORIENTED
OBJECT ORIENTED DESIGN
FACTORS DESIGN
analysis and structured design
i.e, data flow diagram
In this approach the state
In this approach the state
information is not represented in a
information is often
State information centralized memory but is
represented in a centralized
implemented or distributed among
shared memory.
the objects of the system.
47
output. DFDs can be hierarchically organized, which helps in progressively partitioning
and analyzing large systems.
It provides an overview of
What data is system processes.
What transformation are performed.
What data are stored.
What results are produced , etc.
Data Flow Diagram can be represented in several ways. The Data Flow Diagram (DFD)
belongs to structured-analysis modeling tools. Data Flow diagrams are very popular
because they help us to visualize the major steps and data involved in software-system
processes.
Characteristics of Data Flow Diagram (DFD)
Below are some characteristics of Data Flow Diagram (DFD):
1. Graphical Representation: Data Flow Diagram (DFD) use different symbols and
notation to represent data flow within system. That simplify the complex model.
2. Problem Analysis: Data Flow Diagram (DFDs) are very useful in understanding a
system and can be effectively used during analysis. Data Flow Diagram (DFDs) are quite
general and are not limited to problem analysis for software requirements specification.
3. Abstraction: Data Flow Diagram (DFD) provides a abstraction to complex model i.e.
DFD hides unnecessary implementation details and show only the flow of data and
processes within information system.
4. Hierarchy: Data Flow Diagram (DFD) provides a hierarchy of a system. High- level
diagram i.e. 0-level diagram provides an overview of entire system while lower-level
diagram like 1-level DFD and beyond provides a detailed data flow of individual process.
5. Data Flow: The primary objective of Data Flow Diagram (DFD) is to visualize the
data flow between external entity, processes and data store. Data Flow is represented by
an arrow Symbol.
6. Ease of Understanding: Data Flow Diagram (DFD) can be easily understand by both
technical and non-technical stakeholders.
48
7. Modularity: Modularity can be achieved using Data Flow Diagram (DFD) as it breaks
the complex system into smaller module or processes. This provides easily analysis and
design of a system.
1. Logical Data Flow Diagram (DFD): Logical data flow diagram mainly focuses
on the system process. It illustrates how data flows in the system. Logical Data
Flow Diagram (DFD) mainly focuses on high level processes and data flow
without diving deep into technical implementation details. Logical DFD is used in
various organizations for the smooth running of system. Like in a Banking
software system, it is used to describe how data is moved from one entity to
another.
2. Physical Data Flow Diagram: Physical data flow diagram shows how the
data flow is actually implemented in the system. In the Physical Data Flow
49
Diagram (DFD), we include additional details such as data storage, data
transmission, and specific technology or system components. Physical DFD is
more specific and close to implementation.
50
1) 2-Level Data Flow Diagram (DFD): 2-Level provides an even more
detailed view of the system by breaking down the sub-processes identified in the
level 1 Data Flow Diagram (DFD) into further sub-processes. Each sub-process
is depicted as a separate process on the level 2 DFD. The data flows and data
stores associated with each sub-process are also shown.
2-Level Data Flow Diagram (DFD) goes one step deeper into parts of 1-level DFD. It can
be used to plan or record the specific/necessary detail about the system’s functioning.
2) 3-Level Data Flow Diagram (DFD): 3-Level is the most detailed level of
Data Flow Diagram (DFDs), which provides a detailed view of the processes,
data flows, and data stores in the system. This level is typically used for complex
systems, where a high level of detail is required to understand the system. Each
process on the level 3 DFD is depicted with a detailed description of its input,
processing, and output. The data flows and data stores associated with each
process are also shown.
51
Advantages of Data Flow Diagram (DFD)
1) It helps us to understand the functioning and the limits of a system.
2) It is a graphical representation which is very easy to understand as it helps visualize
contents.
3) Data Flow Diagram represent detailed and well explained diagram of system
components.
4) It is used as the part of system documentation file.
5) Data Flow Diagrams can be understood by both technical or nontechnical person
because they are very easy to understand.
52
2) Limited focus: DFDs focus primarily on the flow of data in a system, and may not
capture other important aspects of the system, such as user interface design, system
security, or system performance.
3) Can be difficult to keep up-to-date: DFDs may become out-of-date over time as the
system evolves and changes.
4) Requires technical expertise: While DFDs are easy to understand, creating them
requires a certain level of technical expertise and familiarity with the system being
analyzed.
53
Diamond: Diamonds represent Relationships among Entities.
Lines: Lines represent attributes to entities and entity sets with other relationship
types.
Double Ellipse: Double Ellipses represent Multi-Valued Attributes.
Double Rectangle: Double Rectangle represents a Weak Entity.
What is Entity?
An Entity may be an object with a physical existence – a particular person, car, house, or
employee – or it may be an object with a conceptual existence – a company, a job, or a
university course.
54
What is Entity Set?
An Entity is an object of Entity Type and a set of all entities is called an entity set. For
Example, E1 is an entity having Entity Type Student and the set of all students is called
Entity Set. In ER diagram, Entity Type is represented as:
We can represent the entity set in ER Diagram but can’t represent entity in ER Diagram
because entity is row and column in the relation and ER Diagram is graphical
representation of data.
Types of Entity: There are two types of entity.
1. Strong Entity: A Strong Entity is a type of entity that has a key Attribute.
Strong Entity does not depend on other Entity in the Schema. It has a primary
key, that helps in identifying it uniquely, and it is represented by a rectangle.
These are called Strong Entity Types.
2. Weak Entity: An Entity type has a key attribute that uniquely identifies each
entity in the entity set. But some entity type exists for which key attributes can’t
be defined. These are called Weak Entity types .
For Example, A company may store the information of dependents (Parents, Children,
Spouse) of an Employee. But the dependents can’t exist without the employee. So
Dependent will be a Weak Entity Type and Employee will be Identifying Entity type for
Dependent, which means it is Strong Entity Type .
A weak entity type is represented by a Double Rectangle. The participation of weak
entity types is always total. The relationship between the weak entity type and its
identifying strong entity type is called identifying relationship and it is represented by a
double diamond.
55
What is Attributes?
Attributes are the properties that define the entity type. For example, Roll_No, Name,
DOB, Age, Address, and Mobile_No are the attributes that define entity type Student. In
ER diagram, the attribute is represented by an oval.
Types of Attributes
1. Key Attribute : The attribute which uniquely identifies each entity in the
entity set is called the key attribute. For example, Roll_No will be unique for each
student. In ER diagram, the key attribute is represented by an oval with
underlying lines.
56
3. Multivalued Attribute : An attribute consisting of more than one value for a
given entity. For example, Phone_No (can be more than one for a given student).
In ER diagram, a multivalued attribute is represented by a double oval .
4. Derived Attribute : An attribute that can be derived from other attributes of the
entity type is known as a derived attribute. e.g.; Age (can be derived from DOB).
In ER diagram, the derived attribute is represented by a dashed oval.
The Complete Entity Type Student with its Attributes can be represented as:
57
ER diagram, the relationship type is represented by a diamond and connecting the entities
with lines.
A set of relationships of the same type is known as a relationship set. The following
relationship set depicts S1 as enrolled in C2, S2 as enrolled in C1, and S3 as registered in
C3.
2. Binary Relationship: When there are TWO entities set participating in a relationship,
the relationship is called a binary relationship. For example, a Student is enrolled in a
Course.
58
3. Ternary Relationship: When there are three entity sets participating in a relationship,
the relationship is called a ternary relationship.
4. N-ary Relationship: When there are n entities set participating in a relationship, the
relationship is called an n-ary relationship.
What is Cardinality?
The number of times an entity of an entity set participates in a relationship set is
known as cardinality .
Cardinality can be of different types:
1. One-to-One: When each entity in each entity set can take part only once in the
relationship, the cardinality is one-to-one. Let us assume that a male can marry one
female and a female can marry one male. So the relationship will be one-to-one.
the total number of tables that can be used in this is 2
59
assume that one surgeon department can accommodate many doctors. So the Cardinality
will be 1 to M. It means one department has many Doctors.
total number of tables that can used is 3.
3. Many-to-One: When entities in one entity set can take part only once in the
relationship set and entities in other entity sets can take part more than once in the
relationship set, cardinality is many to one. Let us assume that a student can take only one
course but one course can be taken by many students. So the cardinality will be n to 1. It
means that for one course there can be n students but for one student, there will be only
one course.
The total number of tables that can be used in this is 3.
60
In this case, each student is taking only 1 course but 1 course has been taken by many
students.
4. Many-to-Many: When entities in all entity sets can take part more than once in the
relationship cardinality is many to many. Let us assume that a student can take more than
one course and one course can be taken by many students. So the relationship will be
many to many.
the total number of tables that can be used in this is 3.
61
In this example, student S1 is enrolled in C1 and C3 and Course C3 is enrolled by S1, S3,
and S4. So it is many-to-many relationships.
62
ER Diagram of Bank Management System:
63
Following are the differences between SA and SD
Aspect Structural Analysis Structural Design
Establishes the system's overall structure and Converts the high-level architecture into
Purpose behaviour while meeting high-level detailed requirements for each component or
requirements module.
Example Archi, Enterprise Architect. Visual Studio, Eclipse, and Rational Rose
64