UNIT - 2 - Software Design at CSJMU - 6 Slides Hanouts
UNIT - 2 - Software Design at CSJMU - 6 Slides Hanouts
Software Design
More creative than analysis
Problem solving activity
Unit II
Bridge the gap bet specifications & coding
Software Design for large projects
WHAT IS DESIGN
‘HOW’
1 2
Completed design
Fig. 1 : Design framework
Software Engineering UNIT II . 3 Dr. Rabins Porwal Software Engineering UNIT II . 4 Dr. Rabins Porwal
3 4
5 6
7 8
Software Engineering UNIT II . 9 Dr. Rabins Porwal Software Engineering UNIT II . 10 Dr. Rabins Porwal
9 10
Software Engineering UNIT II . 11 Dr. Rabins Porwal Software Engineering UNIT II . 12 Dr. Rabins Porwal
11 12
13 14
15 16
Software Engineering UNIT II . 17 Dr. Rabins Porwal Software Engineering UNIT II . 18 Dr. Rabins Porwal
17 18
19 20
21 22
23 24
Common coupling
With common coupling, module A and module B have shared
data. Global data areas are commonly found in programming
languages. Making a change to the common data means tracing
back to all the modules which access that data to evaluate the
effect of changes. Fig. 8 : Example of common coupling
Software Engineering UNIT II . 25 Dr. Rabins Porwal Software Engineering UNIT II . 26 Dr. Rabins Porwal
25 26
Content coupling
Content coupling occurs when module A changes data of
module B or when control is passed from one module to the
middle of another. In Fig. 9, module B branches into D, even
though D is supposed to be under the control of C.
Fig. 9 : Example of content coupling
Software Engineering UNIT II . 27 Dr. Rabins Porwal Software Engineering UNIT II . 28 Dr. Rabins Porwal
27 28
Coincidental cohesion
29 30
31 32
Software Engineering UNIT II . 33 Dr. Rabins Porwal Software Engineering UNIT II . 34 Dr. Rabins Porwal
33 34
Software Engineering UNIT II . 35 Dr. Rabins Porwal Software Engineering UNIT II . 36 Dr. Rabins Porwal
35 36
37 38
First, even pre-existing code, if any, needs to be understood, Now flowcharts are seldom used for design of large and complex
organized and pieced together. software. The result is that other notations were designed for
expressing design, and these are at “higher level” than flow charts.
Second, it is still common for the project team to have to write
This helped to minimize the length of jumps from specification to
some code and produce original programs that support the design and design to code.
application logic of the system.
Software Engineering UNIT II . 39 Dr. Rabins Porwal Software Engineering UNIT II . 40 Dr. Rabins Porwal
39 40
41 42
43 44
Software Design
Hybrid Design
Software Design
Pure top-down or bottom-up approaches are often not practical. FUNCTION ORIENTED DESIGN
For a bottom-up approach to be successful, we must have a good Function oriented design is an approach to software design where
notion of the top to which the design should be heading. the design is decomposed into a set of interacting units where each
For top-down approach to be effective, some bottom-up approach is unit has a clearly defined function. Thus, system is designed from
essential for the following reasons: a functional viewpoint.
Its special variety is stepwise refinement, and it is a top down
To permit common sub modules. design method. We start with a high level description of what the
Near the bottom of the hierarchy, where the intuition is simpler, program does. Then, in each step, we take one part of our high
and the need for bottom-up testing is greater, because there are level description and refine it, i.e. specify in somewhat greater
more number of modules at low levels than high levels. detail what that particular part does.
In the use of pre-written library modules, in particular, reuse of This method works fine for small programs.
modules.
Software Engineering UNIT II . 45 Dr. Rabins Porwal Software Engineering UNIT II . 46 Dr. Rabins Porwal
45 46
47 48
Data Dictionaries
Structure Charts
Pseudocode
Fig. 15 : Design reusable structure
Software Engineering UNIT II . 49 Dr. Rabins Porwal Software Engineering UNIT II . 50 Dr. Rabins Porwal
49 50
51 52
Software Design
Software Design A structure chart for “update file” is given in fig. 18.
53 54
55 56
Functions are built in layers, Additional notation is used to Function Parameters (problem variables, types, purpose,
specify details. etc.)
Author, date
Software Engineering UNIT II . 57 Dr. Rabins Porwal Software Engineering UNIT II . 58 Dr. Rabins Porwal
57 58
Any other limitations Object Oriented Design begins with an examination of the real
world “things” that are part of the problem to be solved. These
things (which we will call objects) are characterized individually in
Level 3 terms of their attributes and behavior.
Body (structured chart, English pseudo code, decision
tables, flow charts, etc.)
Software Engineering UNIT II . 59 Dr. Rabins Porwal Software Engineering UNIT II . 60 Dr. Rabins Porwal
59 60
Software Engineering UNIT II . 61 Dr. Rabins Porwal Software Engineering UNIT II . 62 Dr. Rabins Porwal
61 62
63 64
Software Engineering UNIT II . 65 Dr. Rabins Porwal Software Engineering UNIT II . 66 Dr. Rabins Porwal
65 66
vi. Operations
An operation is a function or transformation that may be applied to or
by objects in a class. In the square class, we have two operations: set
colour() and draw(). All objects in a class share the same operations.
An object “knows” its class, and hence the right implementation of the
operation. Operation are shown in the third part of the class as
indicated in fig. 21. Fig. 22: The triangle class
Software Engineering UNIT II . 67 Dr. Rabins Porwal Software Engineering UNIT II . 68 Dr. Rabins Porwal
67 68
69 70
71 72
73 74
75 76
Software Engineering UNIT II . 77 Dr. Rabins Porwal Software Engineering UNIT II . 78 Dr. Rabins Porwal
77 78
a) Association are semantic connection between classes. When c) Aggregations are stronger form of association. An
an association connects two classes, each class can send aggregation is a relationship between a whole and its parts.
messages to the other in a sequence or a collaboration
diagram. Associations can be bi-directional or unidirectional.
Software Engineering UNIT II . 79 Dr. Rabins Porwal Software Engineering UNIT II . 80 Dr. Rabins Porwal
79 80
81 82