SE Unit III
SE Unit III
Unit – III
Software Design
Dr. S. Manikandan
HOD-IT
1
1. Design Process
2
The following items are designed and documented
during the design phase:
• Different modules required.
• Control relationships among modules.
• Interface among different modules.
• Data structure among the different modules.
• Algorithms required to implement among the
individual modules.
3
1.1 Characteristics for the evaluation of a
good design
4
1.2 Software quality guidelines
5
5. Design components must show the independent
functional characteristic.
6. A design creates an interface that reduce the
complexity of connections between the components.
7. A design must be derived using the repeatable
method.
8. The notations should be use in design which can
effectively communicates its meaning.
6
1.3 Quality Attributes
7
• Supportability:
– It combines the ability to extend the program, adaptability,
serviceability. These three term defines the maintainability.
– Testability, compatibility and configurability are the terms using
which a system can be easily installed and found the problem
easily.
8
2. Design Concepts
9
• Abstraction- hide Irrelevant data
• Modularity- subdivide the system
• Architecture- design a structure of something
• Refinement- removes impurities
• Pattern- a repeated form
• Information Hiding- hide the information
• Refactoring- reconstruct something
• Functional Independence- Cohesion, Coupling
10
2.1 Abstraction
• Abstraction is the act of representing essential features
without including the background details or explanations.
• Abstraction is used to reduce complexity and allow efficient
design and implementation of complex software systems.
• Many levels of abstraction can be posed. At the highest
level of abstraction, a solution is stated in broad terms
using the language of the problem environment. At lower
levels of abstraction, a more detailed description of the
solution is provided.
• A procedural abstraction refers to a sequence of
instructions that have a specific and limited function.
• A data abstraction is a named collection of data that
describes a data object.
11
2.2 Modularity
12
Modularity and Software Cost Graph
13
2.3 Information Hiding
14
2.4 Functional Independence
15
2.5 Refinement
16
2.6 Refactoring
17
2.7 Architecture
18
2.8 Pattern
19
3. Design Model
20
Elements of Design Model
21
2. Architectural design elements
• The architecture design elements provides us overall
view of the system.
• The architectural design element is generally
represented as a set of interconnected subsystem that
are derived from analysis packages in the requirement
model.
The architecture model is derived from following sources:
• The information about the application domain to built
the software.
• Requirement model elements like data flow diagram or
analysis classes, relationship and collaboration
between them.
• The architectural style and pattern as per availability. 22
3. Interface design elements
• The interface design elements for software represents
the information flow within it and out of the system.
• They communicate between the components defined
as part of architecture.
Following are the important elements of the interface
design:
1. The user interface
2. The external interface to the other systems,
networks etc.
3. The internal interface between various components.
23
4. Component level diagram elements
• The component level design for software is similar to the set
of detailed specification of each room in a house.
• The component level design for the software completely
describes the internal details of the each software
component.
• The processing of data structure occurs in a component and
an interface which allows all the component operations.
• In a context of object-oriented software engineering, a
component shown in a UML diagram.
• The UML diagram is used to represent the processing logic.
24
5. Deployment level design elements
• The deployment level design element shows the
software functionality and subsystem that allocated in
the physical computing environment which support the
software.
• Following figure shows three computing environment
as shown. These are the personal computer, the CPI
server and the Control panel.
25
26
4. Architectural Design
27
28
Architectural Context diagram for the Safe Home
security function
29
• An archetype is a class or pattern that represents a
core abstraction that is critical to the design of an
architecture for the target system
30
Overall architectural structure for Safe Home
with top-level components
31
32
5. User Interface Design Elements
33
There are two types of User Interface:
• Command Line Interface: Command Line Interface
provides a command prompt, where the user types the
command and feeds to the system. The user needs to
remember the syntax of the command and its use.
• Graphical User Interface: Graphical User Interface
provides the simple interactive interface to interact with
the system. GUI can be a combination of both
hardware and software. Using GUI, user interprets the
software.
34
5.1 Golden Rules
The following are the golden rules stated by Theo Mandel that
must be followed during the design of the interface.
Place the user in control:
• Define the interaction modes in such a way that does not
force the user into unnecessary or undesired actions
• Provide for flexible interaction
• Allow user interaction to be interruptable and undoable:
• Streamline interaction as skill level advances and allow the
interaction to be customized
• Hide technical internals from casual users
• Design for direct interaction with objects that appear on
screen:
35
Reduce the user’s memory load:
• Reduce demand on short-term memory
• Establish meaningful defaults
• Define shortcuts that are intuitive:
• The visual layout of the interface should be based on
a real-world metaphor:.
• Disclose information in a progressive fashion:
36
Make the interface consistent:
• Allow the user to put the current task into a
meaningful context
• Maintain consistency across a family of applications:
• If past interactive models have created user
expectations do not make changes unless there is a
compelling reason.
37
User Interface Analysis
38
5.2 User Interface Design Process
39
• Interface analysis focuses on the profile of the users who
will interact with the system. – A more detailed task analysis
is conducted. – Analysis of the user environment focuses on
the physical work environment. Eg. Where will the interface
be located physically? Will the user be sitting, standing, or
performing other tasks unrelated to the interface?
• Interface design defines a set of interface objects and
actions (and their screen representations) to perform all
defined tasks to meet every usability goal defined for the
system.
40
• Interface construction evaluates usage scenarios by
creating prototype. As the iterative design process
continues, a user interface tool kit may be used to
complete the construction of the interface.
• Interface validation focuses on – User task
correctness – task variations – Cover user requirement
– Ease of use – Easy to learn – the users’ acceptance
41
6. Component level design
42
Component Views
• OO View – A component is a set of collaborating
classes.
• Traditional View – A component is a functional
element of a program that incorporates processing
logic, the internal data structures required to implement
the processing logic, and an interface that enables the
component to be invoked and data to be passed to it.
43
Elaboration of a design component – OO View
44
Structure Chart for a traditional system
45
Designing Class based components
46
Basic Design Principles applicable to
component level design
• The Open-Closed Principle (OCP). “A module
[component] should be open for extension but closed for
modification.
• Design should specify the component in a way that allows
it to be extended (within the functional domain that it
addresses) without the need to make internal (code or
logic-level) modifications to the component itself.
• The Liskov Substitution Principle (LSP). “Subclasses
should be substitutable for their base classes.
• A component that contains the base class and if that
component works properly then the same component
should work properly even if the derived class of that base
class is used by the component as a substitute.
47
• Dependency Inversion Principle (DIP). “Depend on
abstractions. Do not depend on concretions.”
• This is because of some component has to be
extended then it becomes easy to enhance it using
other abstract component instead of concrete
component.
• The Interface Segregation (Separation) Principle
(ISP). “Many client-specific interfaces are better than
one general purpose interface.
• According to this principle, designer should create
specialized interfaces for each major category.
48
Coupling
49
1. No Direct Coupling: There is no direct coupling between
M1 and M2.
2. Data Coupling
When data of one module is passed
to another module, this is called
data coupling.
50
• 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.
51
• 6. Common Coupling: Two modules are common
coupled if they share information through some global
data items.
52
Cohesion
• Cohesion measures the strength of relationships
between pieces of functionality within a given module.
Types of Cohesion
• Functional Cohesion: Functional Cohesion is said to
exist if the different elements of a module, cooperate to
achieve a single function.
• Sequential Cohesion: A module is said to possess
sequential cohesion if the element of a module form the
components of the sequence, where the output from one
component of the sequence is input to the next.
• Communicational Cohesion: A module is said to have
communicational cohesion, if all tasks of the module
refer to or update the same data structure, e.g., the set
of functions defined on an array or a stack.
53
• Procedural Cohesion: A module is said to be procedural
cohesion if the set of purpose of the module are all parts of a
procedure in which particular sequence of steps has to be
carried out for achieving a goal, e.g., the algorithm for
decoding a message.
• Temporal Cohesion: When a module includes functions that
are associated by the fact that all the methods must be
executed in the same time, the module is said to exhibit
temporal cohesion.
• Logical Cohesion: A module is said to be logically cohesive if
all the elements of the module perform a similar operation. For
example Error handling, data input and data output, etc.
• Coincidental Cohesion: A module is said to have coincidental
cohesion if it performs a set of tasks that are associated with
each other very loosely, if at all.
54
Component-Level Design Steps
56
Pattern based design
57
Kinds of Patterns
58
• Interface design patterns describe common user interface
problems and their solution with a system of forces that
includes the specific characteristics of end-users.
• WebApp patterns address a problem set that is encountered
when building WebApps and often incorporates many of the
other patterns categories just mentioned.
• Creational patterns focus on the “creation, composition,
and representation of objects, e.g.,
– Abstract factory pattern: centralize decision of what
factory to instantiate
– Factory method pattern: centralize creation of an object
of a specific type choosing one of several
implementations
59
• Structural patterns focus on problems and solutions
associated with how classes and objects are organized and
integrated to build a larger structure, e.g.,
– Adapter pattern: 'adapts' one interface for a class into one
that a client expects
– Aggregate pattern: a version of the Composite pattern with
methods for aggregation of children
• Behavioral patterns address problems associated with the
assignment of responsibility between objects and the manner
in which communication is effected between objects, e.g.,
– Chain of responsibility pattern: Command objects are
handled or passed on to other objects by logic-containing
processing objects
– Command pattern: Command objects encapsulate an
action and its parameters 60
Framworks
61
Describing a Pattern
62
• Solution : provides a detailed description of the solution
proposed for the problem
• Intent : describes the pattern and what it does
• Collaborations : describes how other patterns contribute
to the solution
• Consequences : describes the potential trade-offs that
must be considered when the pattern is implemented and
the consequences of using the pattern
• Implementation : identifies special issues that should be
considered when implementing the pattern
• Known uses : provides examples of actual uses of the
design pattern in real applications
• Related patterns : cross-references related design
patterns
63
Pattern based design in context
Pattern based Software Design
64
Thinking in Patterns
Shalloway and Trott [Sha05] suggest the following approach
that enables a designer to think in patterns:
• Be sure you understand the big picture—the context in which
the software to be built resides. The requirements model
should communicate this to you.
• Examining the big picture, extract the patterns that are present
at that level of abstraction.
• Begin your design with ‘big picture’ patterns that establish a
context or skeleton for further design work.
• “Work inward from the context” [Sha05] looking for patterns at
lower levels of abstraction that contribute to the design
solution.
• Repeat steps 1 to 4 until the complete design is fleshed out.
• Refine the design by adapting each pattern to the specifics of
the software you’re trying to build. 65
Design Tasks
66
Common design mistakes
67