modeling
Prototype
Spec
Design
Software Design Concepts
An Important Quote
"Questions about whether design is
necessary or affordable are quite beside
the point; design is inevitable. The
alternative to good design is bad design,
[rather than] no design at all."
- Douglas Martin
Software Design Concepts
Design Purpose
• Design is where customer requirements,
business needs, and technical considerations
all come together in the formulation of a
product or system
• The design model provides detail about the
software data structures, architecture,
interfaces, and components
• Software design is an iterative process
through which requirements are translated
into a blueprint for constructing the
software
Software Design Concepts
Analysis Phase to Design Phase
Software Design Concepts
Analysis Phase to Design Phase
• Each element of the analysis model
provides information that is necessary to
create the four design models
– The data/class design transforms
analysis classes into design classes along
with the data structures required to
implement the software
– The architectural design defines the
relationship between major structural
elements of the software; architectural
styles and design patterns help achieve the
requirements defined for the system
Software Design Concepts
– The interface design describes how the
software communicates with systems
that interoperate with it and with
humans that use it
– The component-level design transforms
structural elements of the software
architecture into a procedural
description of software components
Software Design Concepts
Component-level Design
Interface Design
Architectural Design
Data/Class Design
Code
Other Procedural
requirements design Program Test
modules
Software Design Concepts
Fundamental Design Concepts
1) Abstraction
– Procedural abstraction – a sequence of
instructions that have a specific and limited
function
– Data abstraction – a named collection of
data that describes a data object
Software Design Concepts
Procedural Abstraction
open
details of enter
algorithm
door
manufacturer
model number
type
swing direction
inserts
lights
type
number
weight
opening mechanism
walk to door;
reach for knob;
open door; repeat until door opens
turn knob clockwise;
walk through; if knob doesn't turn, then
close door. take key out;
find correct key;
insert in lock;
endif
pull/push door
move out of way;
end repeat
Software Design Concepts
2) Modularity
– Separately named and addressable
components (i.e., modules) that are
integrated to satisfy requirements (divide
and conquer principle)
– Makes software intellectually manageable
so as to grasp the control paths, span of
reference, number of variables, and overall
complexity
– A modular design always helps in building
applications easier, easier to change as
well as to fix errors faster
Software Design Concepts
Trade-offs with Modularity
- What is the “right” number of modules
for a specific software design ?
module development cost
cost of
software
module
integration
cost
number of modules
Optimal number of modules
Software Design Concepts
3) Software Architecture
Definition : IEEE 1471-2000
- Software architecture is the fundamental
organization of a system, embodied in
its components, their relationships to each
other and the environment, and the
principles governing its design and
evolution
- Structure should provide conceptual
integrity
- Consists of components, connectors,
and the relationship between them
Software Design Concepts
Software Architecture addresses three
properties
Architecture:
where non-
functional
decisions are
non-functional architecture cast, and
requirements functional
requirements
are partitioned
functional
requirements design Design:
where
(domains) functional
requirements
are
accomplished
1 3 5 6 7 8
2 4
Bad Good
Software Design Concepts
1) Coincidental cohesion Function A
2) Logical Cohesion
- Elements of a module contribute to
activities of the same general type
- A module that is logically related in
performing activities eg. I/O module,
borrow transaction module etc…
- Modules have better control coupling
here
Software Design Concepts
Example for Logical Cohesion
module display record
use record-type, record
if record-type is student then
display student record
else if record-type is staff then
display staff record
end module
Software Design Concepts
3) Temporal Cohesion
- Elements of the module perform activities
with time eg. initializations, startup
operations etc…
- If elements are unrelated, reusability will be
difficult
Example : module initialise
set counter to 0
open student file
clear error message variable
initialise array
end module
Software Design Concepts
4) Procedural Cohesion
- Elements of a module related by
sequence
- Similar to sequential cohesion, except
for the fact that elements are
unrelated
- Mostly found at the top of the
hierarchy i.e. main module in ‘C’
Software Design Concepts
7) Functional Cohesion
- Contribution of all elements in the
execution of one and only one task
- No elements perform unrelated
activities
eg: writing a record to a database,
booking a rail ticket etc…
Software Design Concepts
8) Informational Cohesion
- Occurs when a module contains
complex data structures and several
routines that manipulate that data
structure
- Techniques which support
informational cohesion are
a) ADTs
b) OOP
Software Design Concepts
Types of Coupling and their impact
• Data coupling good
• Stamp coupling
• Control coupling
• Hybrid coupling
• Common coupling
• Content coupling bad
Software Design Concepts
1) Data Coupling
- Parameter communication by modules
- Data is being sent as Process
parameters Results
- Data is needed for
communicating with other grade
modules
Problems Calculate
- Lot of parameters, interface Grade
understanding difficulties
- Data tramping
Software Design Concepts
2) Stamp Coupling
- Moving composite data types between
modules Process
- A type of coupling where Results
Problems
Update
- Unrelated data getting stored Grade
in the modules
Software Design Concepts
3) Control Coupling
- A module trying to control the logic
of other modules
Check
- Controlling module should record
know about the flexibility
of the other module(s) Error
Problems code
may arise
Software Design Concepts
4) Hybrid coupling
- Using a subset of data and code to
control other modules Main
- Eg: id numbers between program
0001-9999 Data
- If 1000-9099, send an
+
code
email to area-code,
Process
last two digits(00-99) account
Software Design Concepts
5) Common Coupling
- Using global data for communication
between modules Process
Multiple Problems Results
(a) (b)
Example of a
structure
chart
Design Notations
3) HIPO(Hierarchy-Input-Process-
Output) diagrams
- Contains the following items
a) Visual table of contents
b) A set of overview diagrams &
c) A set of detailed diagrams
Example : Inventory System
Design Notations
1.0 Manage inventory
2.0 Update stock
2.1 Process sale
2.2 Process return
2.3 Process shipment
3.0 Generate report
3.1 Respond to query
3.2 Display status report
4.0 Maintain inventory data
4.1 Modify record
4.2 Add record
4.3 Delete record
Tasks to be performed by the inventory system
Design Notations
Card
inser ted
into reader Reading Initialising
Nozzle trigger on
Resetting Stopped
do: display C C
error
P aying
Payment ack.
Hose in
do: debit
CC account holster
Summary
• Real-time system correctness depends
not just on what the system does but
also on how fast it reacts.
• A general RT system model involves
associating processes with sensors and
actuators.
• Real-time systems architectures are
usually designed as a number of
concurrent processes.
Distributed System Design
Objective
- To understand the design of a
distributed system and the issues in
designing such systems
Distributed System Design
Definition
- A distributed system is a collection of
independent computers that appears to
its users as a single coherent system.
Andrew Tanenbaum
Peer Reviews
Revise Check
Documentation
b) Product Standards
- The objective of having a product
standard is to make the specific
product attain a consistent
structure and appearance
- This can be prepared based on
organizational or contractually
required standards
Documentation
c) Interchange Standards
- Creating documents in a format which
allows others to effectively use
a) pdf format for end users
b) Using a word editor for text editing
c) Use of specialized case tools
- Not a problem within one specific
organization, but when data is shared
between organizations, integration
problems are manifold
Documentation
Other Standards
- IEEE template for user documentation
- Writing Style(Ten best practices)
Online documentation
- Internal to the application or web-based
- Change in presentation style since
presenting information on normal paper
is different from presenting on the
internet
- Would act as a supplement to paper
documentation
Documentation
Eg: Using Web-docs are beneficial as they
give current information about the
application
Document Preparation
a) Talks about the entire process of
creating and formatting the document
for publication
- Using specialized tools for document
preparation and publishing
- Vital for user documentation
Documentation
b) Hiring a professional writer or
document publisher to evaluate your
documents before it is published for quality
purposes i.e. would look well on paper
Document Storage
- Using file systems
- Good databases with metadata to help
searching and referencing
- Using a content management system like CVS
or subversion (Free/Open Source, easy to
maintain)
Documentation
- In order to use the developed software
properly and to maintain it effectively
over a period of time, documentation
becomes a mandatory component
Note :
Jackson System Development
Objective
- To understand the Jackson’s method of
system development
Jackson System Development
- Developed by Michael Jackson
- A systematic technique for mapping the
structure of a problem into a program
structure to solve a typical problem
Three Phases of JSD
a) The modeling phase
b) The network phase &
c) The implementation phase
Jackson System Development
a)Modeling Phase
- Identification of events and entities
- Forming entity structures and life
cycles
b) Network Phase
- Adding the necessary inputs and
outputs to the model identified in
phase (a).
Jackson System Development
c) The Implementation Phase
- Detailed design and coding
- Facilitating the specification(model
and function) to run on the hardware
Jackson System Development
Modelling phase – Analysis phase-SDLC
1. Entity/Action step
2. Entity structure step
3. Model process step
Networking phase – Design phase-SDLC
4. Initial model step
5. Function step
6. System timing step
Implementation phase – Coding-SDLC
7. Physical system specification step
Jackson System Development
Highlights of JSD
- Impact on teaching and practice of
commercial computer programming
- Designing effective and efficient well-
tested software
- Has links with formal methods of
software development
- Used in applications where efficiency is
top priority
Jackson System Development
Fundamental Principles of JSD
1) Describe and model the real world
2) Build models that follow the sequence
of the real world
3) Transforming the specification to
efficient set of processes
JSD - Example
• A university gives loans to students.
Before getting a loan, there is an
evaluation process after which agreement
is always reached. A TE transaction
records each step of the evaluation
process, and a TA transaction records the
overall loan agreement. A student can
take any number of loans, but only one
can be active at any time. Each loan is
initiated by a TI transaction.
JSD - Example
• Then, the student repays the loan with a
series of repayments. Each repayment
transaction is recorded by a TR
transaction. Finally, a loan is terminated
by a TT transaction.
• Two output functions are desired: (1) an
inquiry function that prints out the loan
balance for any student, and (2) a
repayment acknowledgment sent to each
student after payment is received by the
university.
JSD - Example
Modeling Phase
Step 1 : Entity/Action step
Entities in the Application
a) Student
b) System
c) University
d) Loan
e) Student-loan
JSD - Example
Actions/Attributes in the Application
a)Evaluate
- University performs the evaluation on
the student based on the following
attributes like student-id, loan-no,
date of evaluation, remarks etc…
b) Agree
- University agrees to give loan, student
also agrees to take loan based on
attributes like student-id,
JSD - Example
- loan-no, date of agreement, amount of
loan, interest rate and repayment
period etc…
c) Make loan
- Make a formal application to execute
the loan
d) Initiate
- University initiates loan, student also
initiates the loan with attributes like
student-id, date-initiated etc…
JSD - Example
e) Repay
- Loan in repaid, student repays the
loan with attributes like student-id,
date of repayment, amount of
repayment etc…
f) Terminate
- The loan gets terminated using
attributes like student-id, date of
termination, remarks etc…
JSD - Example
Step 2 : Entity Structure step
- This step expresses the constraints in
the ordering of an entity’s actions with a
structure diagram
JSD - Example
Step 3 : Model Process Step
- Creating an executable model process for each
entity in the system
- Each model process is described with a system
diagram
Note:
- JSD models each real-world entity i.e. modeling
each entity precisely as it exists in the real
world
- Have to establish a connection between the
entity in the real world and the entity model
process in the designed information system
JSD - Example
SV- State Vector ; DT- Daily Time; ACK – ACKnowledgment; PAL- Payment
Acknowledgment Lister ; S – Serial ; E- Enquiry; R- Result
S – Serial; Enq – Enquiry; DT- Daily Time; SV- State Vector; PAL - Payment
Acknowledgment Lister