SlideShare a Scribd company logo
THE OBJECT-ORIENTED DESIGN
PROCESS AND DESIGN AXIOMS
(CH -9)
By:
Mr.Prachet Bhuyan
Assistant Professor,
School of Computer Engineering,
KIIT University
Topics to be Discussed
9.1 INTRODUCTION
9.2 THE O-O DESIGN PROCESS
9.3 O-O DESIGN AXIOMS
9.4 COROLLARIES
9.4 COROLLARIES
9.4.1 Corollary 1: Uncoupled Design with Less
Information Content
9.4.2 Corollary 2: Single Purpose
9.4.3 Corollary 3: Large Number of Simpler Classes,
Reusability
School of Computer Engineering, KIIT
University
2
Topics to be Discussed contd..
9.4.4 Corollary 4: Strong Mapping
9.4.5 Corollary 5: Standardization
9.4.6 Corollary 6: Designing with Inheritance
9.5 DESIGN PATTERNS
9.5 DESIGN PATTERNS
School of Computer Engineering, KIIT
University
3
9.1 INTRODUCTION
• OOA phase of software development was on
“what needs to be done”.
• The objects discovered during analysis can
serve as the framework for design.
• The class’s attributes, methods and
associations identified during analysis must be
designed for as a data type expressed in the
implementation language.
• New classes can be introduced to store
intermediate result during program execution.
School of Computer Engineering, KIIT
University
4
9.1 INTRODUCTION contd..
• During design phase we elevate the various
object models (individuals, organizations,
machines, etc) into logical entities, some of
which might relate more to the computer
which might relate more to the computer
domain (such as UIs or access layer).
• Good design simplifies the implementation
and maintenance of a project.
• The design model does not look terribly
different from the analysis model.
School of Computer Engineering, KIIT
University
5
9.1 INTRODUCTION contd..
• The difference between OOA & OOD is that, at
OOD level, we focus on the view and access
classes, such as:
– How to maintain information or
– How to maintain information or
– The best way to interact with the a user or
– Present information
• However the time spent on design has a great
impact on the over all success of the software
development project.
School of Computer Engineering, KIIT
University
6
9.1 INTRODUCTION contd..
• Here we look at the O-O design process and
axioms.
• The basic goal of axiomatic process is :
– To formalize the design process
– To formalize the design process
– Assist in establishing a scientific foundation for the
O-O design process
– To provide a fundamental basis for creation of
systems.
School of Computer Engineering, KIIT
University
7
9.2 THE O-O DESIGN PROCESS
OOD Design Process in UA
Continue Testing
School of Computer Engineering, KIIT
University
8
9.2 THE O-O DESIGN PROCESS
The O-O design process consists of the following
activities:
1. Apply design axioms to design classes, their
attributes, methods, associations, structures
attributes, methods, associations, structures
& protocols.
i. Refine and complete the static UML class
diagram by adding details to the UML class
diagram. This steps consists of:
a) Refine attributes
School of Computer Engineering, KIIT
University
9
9.2 THE O-O DESIGN PROCESS contd..
b) Design methods & Protocols by utilizing a UML
activity diagram to represent the method’s algorithm.
c) Refine associations between classes (if required)
d) Refine class hierarchy & design with inheritance (if
required)
required)
ii. Iterate and refine again.
2. Design the access layer (CH-11)
i. Create mirror classes. For every business class
identified and created, create one access class.
ii. Identify access layer class relationships.
School of Computer Engineering, KIIT University 10
9.2 THE O-O DESIGN PROCESS contd..
iii. Simplify classes and their relationships. Eliminate
redundant classes & structures.
a) Redundant classes: Do not keep two classes that
perform similar translate request and translate results
activities. Simply select one and eliminate the other.
activities. Simply select one and eliminate the other.
b) Method classes: Revisit the classes consisting of only
one or two methods to see if they can be eliminated
or combined with existing clases.
iv. Iterate and refine again.
3. Design the view layer classes (CH-12)
School of Computer Engineering, KIIT University 11
9.2 THE O-O DESIGN PROCESS contd..
i. Design the macro level user interface, identifying
view layer objects.
ii. Design the micro level user interface, consists of:
a) Design the view layer objects by applying the design
axioms and corollaries.
b) Build a prototype of the view layer interface.
iii. Test usability & user satisfaction
iv. Iterate & refine.
4. Iterate & refine the whole design.
School of Computer Engineering, KIIT
University
12
9.3 O-O DESIGN AXIOMS
• An axiom is a fundamental truth that always is
observed to be valid and for which there is no
counterexample or exception.
• A theorem is a proposition that may not be self-
• A theorem is a proposition that may not be self-
evident but can be proven from accepted
axioms. (hence equivalent to a law or principle)
• A corollary is a proposition that follows from an
axiom or another proposition that has been
proven.
School of Computer Engineering, KIIT
University
13
9.3 O-O DESIGN AXIOMS contd..
Suh’s design axioms applied to O-O design:
• AXIOM 1: The independence axiom. Maintain the
independence of components.
– Axiom 1 deals with relationships between system
– Axiom 1 deals with relationships between system
components ( such as classes, requirements and
software components)
• AXIOM 2: The information axiom. Minimize the
information content of the design.
– Axiom 2 deals with the complexity of design.
School of Computer Engineering, KIIT
University
14
9.3 O-O DESIGN AXIOMS contd..
• Axiom 2 is concerned with simplicity. Occam’s razor
rule of simplicity in terms of O-O:
– The best designs usually involves the least complex code
but not necessarily the fewest number of classes or
methods.
methods.
– Minimizing complexity should be the goal, because that
produces the most easily maintained and enhanced
application.
– In an o-o system, the best way to minimize complexity is
to use inheritance and the system’s built-in classes and
to add as little as possible to what already is there.
School of Computer Engineering, KIIT
University
15
9.3 O-O DESIGN AXIOMS contd..
• OCCAM’S RAZOR Says..
• “The best theory explains the known
• “The best theory explains the known
facts with a minimum amount of
complexity and maximum simplicity and
straightforwardness.”
School of Computer Engineering, KIIT
University
16
9.4 COROLLARIES
• From the two design axioms, many corollaries
may be derived.
• These corollaries may be more useful in
making specific design decisions, than the
making specific design decisions, than the
original axioms in actual situations.
• They may even be called design rules derived
from two basic axioms.
School of Computer Engineering, KIIT
University
17
9.4 COROLLARIES contd..
• The Origin of Corollaries:
COROLLARY 4
School of Computer Engineering, KIIT
University
18
AXIOM 1
AXIOM 2
COROLLARY 1
COROLLARY 2
COROLLARY 3
COROLLARY 5
COROLLARY 6
9.4 COROLLARIES contd..
• Corollary 1: Uncoupled Design with Less
Information Content.
– Highly cohesive objects can improve coupling
because only a minimal amount of essential
because only a minimal amount of essential
information need be passed between objects.
• Corollary 2: Single Purpose.
– Each class must have a single, clearly defined
purpose which can be describe in few sentences.
School of Computer Engineering, KIIT
University
19
9.4 COROLLARIES contd..
• Corollary 3: Large Number of Simple Classes.
– Keeping the classes simple allows reusability.
• Corollary 4: Strong Mapping.
– There must be strong association between the
physical system (analysis’s object) & logical design
(design’s object)
School of Computer Engineering, KIIT
University
20
9.4 COROLLARIES contd..
• Corollary 5: Standardization. (Promote it.)
– By designing interchangeable components &
– By reusing existing classes & components.
• Corollary 6: Design with Inheritance.
• Corollary 6: Design with Inheritance.
– Common behavior (methods) must be moved to
superclasses.
– The superclass-sub class structure must make
logical sense.
School of Computer Engineering, KIIT
University
21
9.4.1 Corollary 1: Uncoupled Design with
Less Information Content
• The main goal here is:
– To maximize objects cohesiveness among objects &
software components to improve coupling.
• 9.4.1.1 COUPLING: Coupling is a measure of the
• 9.4.1.1 COUPLING: Coupling is a measure of the
strength of association established by a
connection from one object or software
component to another.
– Coupling is a binary relationship: A is coupled with B
– Strong coupling among objects complicates a system.
School of Computer Engineering, KIIT
University
22
9.4.1 Corollary 1: Uncoupled Design with
Less Information Content contd..
• The degree of coupling is a function of:
1. How complicated the connection is.
2. Whether the connection refers to the object
itself or something inside it.
itself or something inside it.
3. What is being sent or received.
• The degree or strength of coupling between
two components is measured by the amount
& complexity of information transmitted
between them.
School of Computer Engineering, KIIT
University
23
9.4.1 Corollary 1: Uncoupled Design with
Less Information Content contd..
• Strong Coupling: Coupling increases (becomes
stronger) with increasing complexity or
obscurity of the interface.
• Low or Weak Coupling: Coupling decreases
• Low or Weak Coupling: Coupling decreases
(becomes lower) when the connection is to
the component interface rather than to an
internal component.
– Coupling also is lower for data connections than
for control connections.
School of Computer Engineering, KIIT
University
24
üO-O Design has TWO types of Coupling:
1. Interaction Coupling : Involves the amount and
complexity of messages between components.
– General Guideline: is to keep the messages as simple
9.4.1 Corollary 1: Uncoupled Design with
Less Information Content contd..
– General Guideline: is to keep the messages as simple
& infrequent as possible.
– Ex: If a message connection involves more than three
parameters (eg: in Method(X,Y,Z) where X,Y,Z are
parameters and any change in one will have ripple
effect of changes in other. Hence TIGHTLY COUPLED.
School of Computer Engineering, KIIT
University
25
• E is a Tightly Coupled Object:
9.4.1 Corollary 1: Uncoupled Design with
Less Information Content contd..
A B C
School of Computer Engineering, KIIT
University
26
D E F
I
H
G
• Types of Interaction Coupling are:
9.4.1 Corollary 1: Uncoupled Design with
Less Information Content contd..
DEGREE OF
COUPLING
NAME OF COUPLING DESCRIPTION
VERY HIGH CONTENT COUPLING The connection involves direct reference to
attributes or methods of another object.
HIGH COMMON COUPLING The connection involves two objects accessing
School of Computer Engineering, KIIT
University
27
HIGH COMMON COUPLING The connection involves two objects accessing
a global data space for both to read & write.
MEDIUM CONTROL COUPLING The connection involves explicit control of the
processing logic of one object by another.
LOW STAMP COUPLING Involves passing an aggregate data structure to
another object, using partial of it.
VERY LOW DATA COUPLING (Should
be the goal of
Architectural Design)
Involves either simple data items or aggregate
structures all of whose elements are used by
the receiving object.
2. Inheritance Coupling: It is a form of coupling
between super and sub classes.
– A subclass is coupled to its super class in terms of
attributes and methods.
9.4.1 Corollary 1: Uncoupled Design with
Less Information Content contd..
attributes and methods.
– Unlike interaction coupling, high inheritance
coupling is desirable.
School of Computer Engineering, KIIT
University
28
• 9.4.1.2 COHESION : There is a need to
consider interactions within a single object or
software component, called cohesion.
– It reflects the “single-purposeness” of an object.
9.4.1 Corollary 1: Uncoupled Design with
Less Information Content contd..
– It reflects the “single-purposeness” of an object.
– Highly cohesive components can lower coupling as
a minimum information of essential information
need be passes between components.
– It helps to design classes which have very specific
purpose.
School of Computer Engineering, KIIT
University
29
• Types of Cohesion are:
– Method Cohesion: Like function cohesion, means
that method should carry only one function.
– Class Cohesion: It means that all the class’s methods
9.4.1 Corollary 1: Uncoupled Design with
Less Information Content contd..
– Class Cohesion: It means that all the class’s methods
and attributes must be highly cohesive, (used by
internal methods or derived classes’ methods).
– Inheritance Cohesion: - Concerned with:
• How interrelated are the classes ?
• Does specialization really portray specialization or it is just
something arbitrary ?
School of Computer Engineering, KIIT
University
30
• Every class should be clearly defined.
• It is necessary to achieve the system’s goal.
• During documentation we should be able to
explain the purpose of a class in one or two
9.4.2 Corollary 2: Single Purpose
explain the purpose of a class in one or two
sentences.
• If not, then rethink the class and try to subdivide
the class into more independent pieces.
• Keep it simple. (Each method to provide one
service.)
School of Computer Engineering, KIIT
University
31
9.4.3 Corollary 3: Large Number of Simpler
Classes, Reusability
• Simpler classes is beneficial.
• It is difficult to foresee all future scenarios of the
class to be reused.
• The less specialized the classes are, more
• The less specialized the classes are, more
problems can be solved by combining them with
less subclasses. GUIDELINE:
• “The smaller are your classes, the better are your
chances of reusing them in other projects. Large
and complex classes are too specialized to be
reused” School of Computer Engineering, KIIT
University
32
• Coad & Yourdon describes FOUR reasons why
people are not utilizing reusability concept
more:
1. Software engineering textbooks teach new
9.4.3 Corollary 3: Large Number of Simpler
Classes, Reusability contd..
1. Software engineering textbooks teach new
practitioners to build systems from “first
principle”; reusability is not promoted or even
discussed.
School of Computer Engineering, KIIT
University
33
2. The “not invented here” syndrome and the
intellectual challenge of solving problem an
interesting problem in one’s own unique way
mitigates against reusing someone else’s software
component.
9.4.3 Corollary 3: Large Number of Simpler
Classes, Reusability contd..
component.
3. Unsuccessful experiences with software reusability
in the past have convinced many practitioners and
development managers that the concept is not
practical.
School of Computer Engineering, KIIT
University
34
4. Most organization provide no reward for reusability;
sometimes productivity is measured in terms of new
lines of codes written plus a discounted credit (e.g.,
50% less credit) for reused lines of code.
9.4.3 Corollary 3: Large Number of Simpler
Classes, Reusability contd..
• Benefits of Software Reusability:
Ø Higher productivity
Ø The software development team that achieves 80%
reusability is four times as productive as the team
that achieves only 20% reusability.
School of Computer Engineering, KIIT
University
35
ØUsing successful design patterns we can recreate.
ØO-O design encourages reusable libraries
supported by OOP languages.
ØO-O design emphasizes on reusing concepts like:
9.4.3 Corollary 3: Large Number of Simpler
Classes, Reusability contd..
ØO-O design emphasizes on reusing concepts like:
i. Encapsulation
ii. Modularization (e.g., class structure)
iii. Polymorphism
School of Computer Engineering, KIIT
University
36
9.4.4 Corollary 4: Strong Mapping
• OOA & OOD are based on same UML model.
• Eg; During analysis we might identify a class
EMPLOYEE. During the design phase, we need
to design this class:
to design this class:
– Design its methods
– Design its association with other objects
– Design its view & access classes
School of Computer Engineering, KIIT
University
37
• A strong mapping links classes identified
during analysis and classes designed during
the design phase.
• According to Martin & Odell:
9.4.4 Corollary 4: Strong Mapping contd..
• According to Martin & Odell:
– With O-O technique the same paradigm is used
for analysis, design & implementation.
– The analyst identifies objects’ types & inheritance
& think about the events that change the state of
object.
School of Computer Engineering, KIIT
University
38
– The designer adds details to this model perhaps
designing screens, user interaction, and client-
server interaction.
– The thought process flows so naturally from
9.4.4 Corollary 4: Strong Mapping contd..
analyst to design that it may be difficult to tell
where analysis ends and design begins.
School of Computer Engineering, KIIT
University
39
9.4.5 Corollary 5: Standardization
• To reuse one should have good understanding of
classes in OOP environment.
• Most OOP such as Smalltalk, Java, C++, or
PowerBuilder come with built-in class libraries.
PowerBuilder come with built-in class libraries.
• O-O systems grow as you create new
applications.
• The knowledge of existing class will help in reuse
by inheriting from the existing class libraries.
School of Computer Engineering, KIIT
University
40
Some shortfall:
• However class libraries are not always well
documented and updated.
• Class libraries should be easily searched based
9.4.5 Corollary 5: Standardization contd..
• Class libraries should be easily searched based
on user’s criteria.
Solution:
• Making a repository of Design Patterns can
give some solutions to all these problems.
School of Computer Engineering, KIIT
University
41
9.4.6 Corollary 6: Designing with
Inheritance
• When you implement a class you have to
determine its ancestor, along with:
– What attributes it will have &
– What messages it will understand.
– What messages it will understand.
• Then its methods & protocols are constructed.
• Ideally you will choose inheritance to
minimize the amount of program instructions.
School of Computer Engineering, KIIT
University
42
• Issue here will be:
– Achieving Multiple Inheritance in a Single
Inheritance System.
– Avoiding Inheriting Inappropriate Behaviors.
9.4.6 Corollary 6: Designing with
Inheritance contd..
– Avoiding Inheriting Inappropriate Behaviors.
• Eg: Developing an application for the
government that manages the licensing
procedure for a variety of regulated entities:
• Like: License, Motor Vehicle, Private Vehicle,
Commercial Vehicle, Restaurant, FoodTruck.
School of Computer Engineering, KIIT
University
43
• The Initial Inheritance Design
9.4.6 Corollary 6: Designing with
Inheritance contd..
School of Computer Engineering, KIIT
University
44
• The Single Inheritance Design Modified to
Allow Licensing Food Trucks.
9.4.6 Corollary 6: Designing with
Inheritance contd..
School of Computer Engineering, KIIT
University
45
• Alternately you can Modify the Single
Inheritance Design to Allow Licensing Food
Truck.
9.4.6 Corollary 6: Designing with
Inheritance contd..
School of Computer Engineering, KIIT
University
46
• Multiple Inheritance Design of the System
Structure
9.4.6 Corollary 6: Designing with
Inheritance contd..
School of Computer Engineering, KIIT
University
47
• Design Patterns are devices:
– that allows systems to share knowledge about
their design,
– by describing commonly recurring structures of
9.5 DESIGN PATTERNS (Eg:)
– by describing commonly recurring structures of
communicating components
– that solve a general design problem within a
particular context.
• Documenting patterns is one way that allows
reuse & sharing information of best practices.
School of Computer Engineering, KIIT
University
48
Design Pattern example created by Kutotsuchi
• Pattern Name: Facade
• Rational & Motivation: This pattern can make
the task of accessing a large number of
9.5 DESIGN PATTERNS (Eg:) contd..
the task of accessing a large number of
modules much simpler by providing an
additional interface layer.
– This is done by creating a small collection of
classes that have a single class that is used to
access them, the FACADE.
School of Computer Engineering, KIIT
University
49
• Classes: There can be any number of classes
involved in this “facade” system, but
– At least four or more classes are required: One
client, the facade, & the classes underneath the
9.5 DESIGN PATTERNS (Eg:) contd..
client, the facade, & the classes underneath the
facade.
– A facade would be having limited coding most of
the time making calls to lower layers.
• Advantages: Using the facade to make the
interfacing between many modules or classes.
School of Computer Engineering, KIIT
University
50
• Disadvantages: We may loose some
functionality contained in the lower level of
classes, but this depends on how the facade
was designed.
9.5 DESIGN PATTERNS (Eg:) contd..
was designed.
• Example: Imagine there is a need to write a
program that needs to represent a building as
rooms that can be manipulated to interact
with objects(windows, screens, projector, etc)
in the room to change their state.
School of Computer Engineering, KIIT
University
51
• Using a Design Pattern FAÇADE Eliminates the need for
the client class to deal with a large number of classes.
9.5 DESIGN PATTERNS (Eg:) contd..
School of Computer Engineering, KIIT
University
52
• END of CHAPTER 9
• USE DESIGN PATTERNS IN YOUR O-O
• USE DESIGN PATTERNS IN YOUR O-O
SOFTWARE DESIGN
School of Computer Engineering, KIIT
University
53

More Related Content

Similar to ch-9_oosd_the_object-oriented_design_process_and_design_axioms.pdf

From Principles to Strategies for Systems Engineering
From Principles to Strategies for Systems EngineeringFrom Principles to Strategies for Systems Engineering
From Principles to Strategies for Systems Engineering
Glen Alleman
 
CS6502 OOAD - Question Bank and Answer
CS6502 OOAD - Question Bank and AnswerCS6502 OOAD - Question Bank and Answer
CS6502 OOAD - Question Bank and Answer
Gobinath Subramaniam
 
Intro to Software Engineering - Software Design
Intro to Software Engineering - Software DesignIntro to Software Engineering - Software Design
Intro to Software Engineering - Software Design
Radu_Negulescu
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
Dr. C.V. Suresh Babu
 
Unit 5
Unit 5Unit 5
CS8461 Operating System Lab Manual S.Selvi
CS8461 Operating System Lab Manual S.SelviCS8461 Operating System Lab Manual S.Selvi
CS8461 Operating System Lab Manual S.Selvi
SELVI SIVAPERUMAL
 
OOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.pptOOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.ppt
itadmin33
 
Architecture in action 01
Architecture in action 01Architecture in action 01
Architecture in action 01
Krishna Sankar
 
naveed-kamran-software-architecture-agile
naveed-kamran-software-architecture-agilenaveed-kamran-software-architecture-agile
naveed-kamran-software-architecture-agile
Naveed Kamran
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
Asma CHERIF
 
Course Info
Course InfoCourse Info
Course Info
jv66
 
Comp 107cep iii,iv,v
Comp 107cep iii,iv,vComp 107cep iii,iv,v
Comp 107cep iii,iv,v
Bala Ganesh
 
Operations Research Digital Material.pdf
Operations Research Digital Material.pdfOperations Research Digital Material.pdf
Operations Research Digital Material.pdf
TANVEERSINGHSOLANKI
 
Mini Project- Torque Control of a DC Motor
Mini Project- Torque Control of a DC MotorMini Project- Torque Control of a DC Motor
Lecture 3 software_engineering
Lecture 3 software_engineeringLecture 3 software_engineering
Lecture 3 software_engineering
moduledesign
 
Buildability deconstruction
Buildability deconstructionBuildability deconstruction
Buildability deconstruction
Dr Fereidoun Dejahang
 
Sp090317
Sp090317Sp090317
Sp090317
Stuart Palmer
 
Cse 6007 fall2012
Cse 6007 fall2012Cse 6007 fall2012
Cse 6007 fall2012
rhrashel
 
20CB304 - SE - UNIT V - Digital Notes.pptx
20CB304 - SE - UNIT V - Digital Notes.pptx20CB304 - SE - UNIT V - Digital Notes.pptx
20CB304 - SE - UNIT V - Digital Notes.pptx
JayaramB11
 
English Article.pptx
English Article.pptxEnglish Article.pptx
English Article.pptx
FatemehZamani9
 

Similar to ch-9_oosd_the_object-oriented_design_process_and_design_axioms.pdf (20)

From Principles to Strategies for Systems Engineering
From Principles to Strategies for Systems EngineeringFrom Principles to Strategies for Systems Engineering
From Principles to Strategies for Systems Engineering
 
CS6502 OOAD - Question Bank and Answer
CS6502 OOAD - Question Bank and AnswerCS6502 OOAD - Question Bank and Answer
CS6502 OOAD - Question Bank and Answer
 
Intro to Software Engineering - Software Design
Intro to Software Engineering - Software DesignIntro to Software Engineering - Software Design
Intro to Software Engineering - Software Design
 
Object Oriented Analysis and Design
Object Oriented Analysis and DesignObject Oriented Analysis and Design
Object Oriented Analysis and Design
 
Unit 5
Unit 5Unit 5
Unit 5
 
CS8461 Operating System Lab Manual S.Selvi
CS8461 Operating System Lab Manual S.SelviCS8461 Operating System Lab Manual S.Selvi
CS8461 Operating System Lab Manual S.Selvi
 
OOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.pptOOSE Unit 3 PPT.ppt
OOSE Unit 3 PPT.ppt
 
Architecture in action 01
Architecture in action 01Architecture in action 01
Architecture in action 01
 
naveed-kamran-software-architecture-agile
naveed-kamran-software-architecture-agilenaveed-kamran-software-architecture-agile
naveed-kamran-software-architecture-agile
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
 
Course Info
Course InfoCourse Info
Course Info
 
Comp 107cep iii,iv,v
Comp 107cep iii,iv,vComp 107cep iii,iv,v
Comp 107cep iii,iv,v
 
Operations Research Digital Material.pdf
Operations Research Digital Material.pdfOperations Research Digital Material.pdf
Operations Research Digital Material.pdf
 
Mini Project- Torque Control of a DC Motor
Mini Project- Torque Control of a DC MotorMini Project- Torque Control of a DC Motor
Mini Project- Torque Control of a DC Motor
 
Lecture 3 software_engineering
Lecture 3 software_engineeringLecture 3 software_engineering
Lecture 3 software_engineering
 
Buildability deconstruction
Buildability deconstructionBuildability deconstruction
Buildability deconstruction
 
Sp090317
Sp090317Sp090317
Sp090317
 
Cse 6007 fall2012
Cse 6007 fall2012Cse 6007 fall2012
Cse 6007 fall2012
 
20CB304 - SE - UNIT V - Digital Notes.pptx
20CB304 - SE - UNIT V - Digital Notes.pptx20CB304 - SE - UNIT V - Digital Notes.pptx
20CB304 - SE - UNIT V - Digital Notes.pptx
 
English Article.pptx
English Article.pptxEnglish Article.pptx
English Article.pptx
 

Recently uploaded

OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
pavan998932
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 

Recently uploaded (20)

OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
What is Augmented Reality Image Tracking
What is Augmented Reality Image TrackingWhat is Augmented Reality Image Tracking
What is Augmented Reality Image Tracking
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 

ch-9_oosd_the_object-oriented_design_process_and_design_axioms.pdf

  • 1. THE OBJECT-ORIENTED DESIGN PROCESS AND DESIGN AXIOMS (CH -9) By: Mr.Prachet Bhuyan Assistant Professor, School of Computer Engineering, KIIT University
  • 2. Topics to be Discussed 9.1 INTRODUCTION 9.2 THE O-O DESIGN PROCESS 9.3 O-O DESIGN AXIOMS 9.4 COROLLARIES 9.4 COROLLARIES 9.4.1 Corollary 1: Uncoupled Design with Less Information Content 9.4.2 Corollary 2: Single Purpose 9.4.3 Corollary 3: Large Number of Simpler Classes, Reusability School of Computer Engineering, KIIT University 2
  • 3. Topics to be Discussed contd.. 9.4.4 Corollary 4: Strong Mapping 9.4.5 Corollary 5: Standardization 9.4.6 Corollary 6: Designing with Inheritance 9.5 DESIGN PATTERNS 9.5 DESIGN PATTERNS School of Computer Engineering, KIIT University 3
  • 4. 9.1 INTRODUCTION • OOA phase of software development was on “what needs to be done”. • The objects discovered during analysis can serve as the framework for design. • The class’s attributes, methods and associations identified during analysis must be designed for as a data type expressed in the implementation language. • New classes can be introduced to store intermediate result during program execution. School of Computer Engineering, KIIT University 4
  • 5. 9.1 INTRODUCTION contd.. • During design phase we elevate the various object models (individuals, organizations, machines, etc) into logical entities, some of which might relate more to the computer which might relate more to the computer domain (such as UIs or access layer). • Good design simplifies the implementation and maintenance of a project. • The design model does not look terribly different from the analysis model. School of Computer Engineering, KIIT University 5
  • 6. 9.1 INTRODUCTION contd.. • The difference between OOA & OOD is that, at OOD level, we focus on the view and access classes, such as: – How to maintain information or – How to maintain information or – The best way to interact with the a user or – Present information • However the time spent on design has a great impact on the over all success of the software development project. School of Computer Engineering, KIIT University 6
  • 7. 9.1 INTRODUCTION contd.. • Here we look at the O-O design process and axioms. • The basic goal of axiomatic process is : – To formalize the design process – To formalize the design process – Assist in establishing a scientific foundation for the O-O design process – To provide a fundamental basis for creation of systems. School of Computer Engineering, KIIT University 7
  • 8. 9.2 THE O-O DESIGN PROCESS OOD Design Process in UA Continue Testing School of Computer Engineering, KIIT University 8
  • 9. 9.2 THE O-O DESIGN PROCESS The O-O design process consists of the following activities: 1. Apply design axioms to design classes, their attributes, methods, associations, structures attributes, methods, associations, structures & protocols. i. Refine and complete the static UML class diagram by adding details to the UML class diagram. This steps consists of: a) Refine attributes School of Computer Engineering, KIIT University 9
  • 10. 9.2 THE O-O DESIGN PROCESS contd.. b) Design methods & Protocols by utilizing a UML activity diagram to represent the method’s algorithm. c) Refine associations between classes (if required) d) Refine class hierarchy & design with inheritance (if required) required) ii. Iterate and refine again. 2. Design the access layer (CH-11) i. Create mirror classes. For every business class identified and created, create one access class. ii. Identify access layer class relationships. School of Computer Engineering, KIIT University 10
  • 11. 9.2 THE O-O DESIGN PROCESS contd.. iii. Simplify classes and their relationships. Eliminate redundant classes & structures. a) Redundant classes: Do not keep two classes that perform similar translate request and translate results activities. Simply select one and eliminate the other. activities. Simply select one and eliminate the other. b) Method classes: Revisit the classes consisting of only one or two methods to see if they can be eliminated or combined with existing clases. iv. Iterate and refine again. 3. Design the view layer classes (CH-12) School of Computer Engineering, KIIT University 11
  • 12. 9.2 THE O-O DESIGN PROCESS contd.. i. Design the macro level user interface, identifying view layer objects. ii. Design the micro level user interface, consists of: a) Design the view layer objects by applying the design axioms and corollaries. b) Build a prototype of the view layer interface. iii. Test usability & user satisfaction iv. Iterate & refine. 4. Iterate & refine the whole design. School of Computer Engineering, KIIT University 12
  • 13. 9.3 O-O DESIGN AXIOMS • An axiom is a fundamental truth that always is observed to be valid and for which there is no counterexample or exception. • A theorem is a proposition that may not be self- • A theorem is a proposition that may not be self- evident but can be proven from accepted axioms. (hence equivalent to a law or principle) • A corollary is a proposition that follows from an axiom or another proposition that has been proven. School of Computer Engineering, KIIT University 13
  • 14. 9.3 O-O DESIGN AXIOMS contd.. Suh’s design axioms applied to O-O design: • AXIOM 1: The independence axiom. Maintain the independence of components. – Axiom 1 deals with relationships between system – Axiom 1 deals with relationships between system components ( such as classes, requirements and software components) • AXIOM 2: The information axiom. Minimize the information content of the design. – Axiom 2 deals with the complexity of design. School of Computer Engineering, KIIT University 14
  • 15. 9.3 O-O DESIGN AXIOMS contd.. • Axiom 2 is concerned with simplicity. Occam’s razor rule of simplicity in terms of O-O: – The best designs usually involves the least complex code but not necessarily the fewest number of classes or methods. methods. – Minimizing complexity should be the goal, because that produces the most easily maintained and enhanced application. – In an o-o system, the best way to minimize complexity is to use inheritance and the system’s built-in classes and to add as little as possible to what already is there. School of Computer Engineering, KIIT University 15
  • 16. 9.3 O-O DESIGN AXIOMS contd.. • OCCAM’S RAZOR Says.. • “The best theory explains the known • “The best theory explains the known facts with a minimum amount of complexity and maximum simplicity and straightforwardness.” School of Computer Engineering, KIIT University 16
  • 17. 9.4 COROLLARIES • From the two design axioms, many corollaries may be derived. • These corollaries may be more useful in making specific design decisions, than the making specific design decisions, than the original axioms in actual situations. • They may even be called design rules derived from two basic axioms. School of Computer Engineering, KIIT University 17
  • 18. 9.4 COROLLARIES contd.. • The Origin of Corollaries: COROLLARY 4 School of Computer Engineering, KIIT University 18 AXIOM 1 AXIOM 2 COROLLARY 1 COROLLARY 2 COROLLARY 3 COROLLARY 5 COROLLARY 6
  • 19. 9.4 COROLLARIES contd.. • Corollary 1: Uncoupled Design with Less Information Content. – Highly cohesive objects can improve coupling because only a minimal amount of essential because only a minimal amount of essential information need be passed between objects. • Corollary 2: Single Purpose. – Each class must have a single, clearly defined purpose which can be describe in few sentences. School of Computer Engineering, KIIT University 19
  • 20. 9.4 COROLLARIES contd.. • Corollary 3: Large Number of Simple Classes. – Keeping the classes simple allows reusability. • Corollary 4: Strong Mapping. – There must be strong association between the physical system (analysis’s object) & logical design (design’s object) School of Computer Engineering, KIIT University 20
  • 21. 9.4 COROLLARIES contd.. • Corollary 5: Standardization. (Promote it.) – By designing interchangeable components & – By reusing existing classes & components. • Corollary 6: Design with Inheritance. • Corollary 6: Design with Inheritance. – Common behavior (methods) must be moved to superclasses. – The superclass-sub class structure must make logical sense. School of Computer Engineering, KIIT University 21
  • 22. 9.4.1 Corollary 1: Uncoupled Design with Less Information Content • The main goal here is: – To maximize objects cohesiveness among objects & software components to improve coupling. • 9.4.1.1 COUPLING: Coupling is a measure of the • 9.4.1.1 COUPLING: Coupling is a measure of the strength of association established by a connection from one object or software component to another. – Coupling is a binary relationship: A is coupled with B – Strong coupling among objects complicates a system. School of Computer Engineering, KIIT University 22
  • 23. 9.4.1 Corollary 1: Uncoupled Design with Less Information Content contd.. • The degree of coupling is a function of: 1. How complicated the connection is. 2. Whether the connection refers to the object itself or something inside it. itself or something inside it. 3. What is being sent or received. • The degree or strength of coupling between two components is measured by the amount & complexity of information transmitted between them. School of Computer Engineering, KIIT University 23
  • 24. 9.4.1 Corollary 1: Uncoupled Design with Less Information Content contd.. • Strong Coupling: Coupling increases (becomes stronger) with increasing complexity or obscurity of the interface. • Low or Weak Coupling: Coupling decreases • Low or Weak Coupling: Coupling decreases (becomes lower) when the connection is to the component interface rather than to an internal component. – Coupling also is lower for data connections than for control connections. School of Computer Engineering, KIIT University 24
  • 25. üO-O Design has TWO types of Coupling: 1. Interaction Coupling : Involves the amount and complexity of messages between components. – General Guideline: is to keep the messages as simple 9.4.1 Corollary 1: Uncoupled Design with Less Information Content contd.. – General Guideline: is to keep the messages as simple & infrequent as possible. – Ex: If a message connection involves more than three parameters (eg: in Method(X,Y,Z) where X,Y,Z are parameters and any change in one will have ripple effect of changes in other. Hence TIGHTLY COUPLED. School of Computer Engineering, KIIT University 25
  • 26. • E is a Tightly Coupled Object: 9.4.1 Corollary 1: Uncoupled Design with Less Information Content contd.. A B C School of Computer Engineering, KIIT University 26 D E F I H G
  • 27. • Types of Interaction Coupling are: 9.4.1 Corollary 1: Uncoupled Design with Less Information Content contd.. DEGREE OF COUPLING NAME OF COUPLING DESCRIPTION VERY HIGH CONTENT COUPLING The connection involves direct reference to attributes or methods of another object. HIGH COMMON COUPLING The connection involves two objects accessing School of Computer Engineering, KIIT University 27 HIGH COMMON COUPLING The connection involves two objects accessing a global data space for both to read & write. MEDIUM CONTROL COUPLING The connection involves explicit control of the processing logic of one object by another. LOW STAMP COUPLING Involves passing an aggregate data structure to another object, using partial of it. VERY LOW DATA COUPLING (Should be the goal of Architectural Design) Involves either simple data items or aggregate structures all of whose elements are used by the receiving object.
  • 28. 2. Inheritance Coupling: It is a form of coupling between super and sub classes. – A subclass is coupled to its super class in terms of attributes and methods. 9.4.1 Corollary 1: Uncoupled Design with Less Information Content contd.. attributes and methods. – Unlike interaction coupling, high inheritance coupling is desirable. School of Computer Engineering, KIIT University 28
  • 29. • 9.4.1.2 COHESION : There is a need to consider interactions within a single object or software component, called cohesion. – It reflects the “single-purposeness” of an object. 9.4.1 Corollary 1: Uncoupled Design with Less Information Content contd.. – It reflects the “single-purposeness” of an object. – Highly cohesive components can lower coupling as a minimum information of essential information need be passes between components. – It helps to design classes which have very specific purpose. School of Computer Engineering, KIIT University 29
  • 30. • Types of Cohesion are: – Method Cohesion: Like function cohesion, means that method should carry only one function. – Class Cohesion: It means that all the class’s methods 9.4.1 Corollary 1: Uncoupled Design with Less Information Content contd.. – Class Cohesion: It means that all the class’s methods and attributes must be highly cohesive, (used by internal methods or derived classes’ methods). – Inheritance Cohesion: - Concerned with: • How interrelated are the classes ? • Does specialization really portray specialization or it is just something arbitrary ? School of Computer Engineering, KIIT University 30
  • 31. • Every class should be clearly defined. • It is necessary to achieve the system’s goal. • During documentation we should be able to explain the purpose of a class in one or two 9.4.2 Corollary 2: Single Purpose explain the purpose of a class in one or two sentences. • If not, then rethink the class and try to subdivide the class into more independent pieces. • Keep it simple. (Each method to provide one service.) School of Computer Engineering, KIIT University 31
  • 32. 9.4.3 Corollary 3: Large Number of Simpler Classes, Reusability • Simpler classes is beneficial. • It is difficult to foresee all future scenarios of the class to be reused. • The less specialized the classes are, more • The less specialized the classes are, more problems can be solved by combining them with less subclasses. GUIDELINE: • “The smaller are your classes, the better are your chances of reusing them in other projects. Large and complex classes are too specialized to be reused” School of Computer Engineering, KIIT University 32
  • 33. • Coad & Yourdon describes FOUR reasons why people are not utilizing reusability concept more: 1. Software engineering textbooks teach new 9.4.3 Corollary 3: Large Number of Simpler Classes, Reusability contd.. 1. Software engineering textbooks teach new practitioners to build systems from “first principle”; reusability is not promoted or even discussed. School of Computer Engineering, KIIT University 33
  • 34. 2. The “not invented here” syndrome and the intellectual challenge of solving problem an interesting problem in one’s own unique way mitigates against reusing someone else’s software component. 9.4.3 Corollary 3: Large Number of Simpler Classes, Reusability contd.. component. 3. Unsuccessful experiences with software reusability in the past have convinced many practitioners and development managers that the concept is not practical. School of Computer Engineering, KIIT University 34
  • 35. 4. Most organization provide no reward for reusability; sometimes productivity is measured in terms of new lines of codes written plus a discounted credit (e.g., 50% less credit) for reused lines of code. 9.4.3 Corollary 3: Large Number of Simpler Classes, Reusability contd.. • Benefits of Software Reusability: Ø Higher productivity Ø The software development team that achieves 80% reusability is four times as productive as the team that achieves only 20% reusability. School of Computer Engineering, KIIT University 35
  • 36. ØUsing successful design patterns we can recreate. ØO-O design encourages reusable libraries supported by OOP languages. ØO-O design emphasizes on reusing concepts like: 9.4.3 Corollary 3: Large Number of Simpler Classes, Reusability contd.. ØO-O design emphasizes on reusing concepts like: i. Encapsulation ii. Modularization (e.g., class structure) iii. Polymorphism School of Computer Engineering, KIIT University 36
  • 37. 9.4.4 Corollary 4: Strong Mapping • OOA & OOD are based on same UML model. • Eg; During analysis we might identify a class EMPLOYEE. During the design phase, we need to design this class: to design this class: – Design its methods – Design its association with other objects – Design its view & access classes School of Computer Engineering, KIIT University 37
  • 38. • A strong mapping links classes identified during analysis and classes designed during the design phase. • According to Martin & Odell: 9.4.4 Corollary 4: Strong Mapping contd.. • According to Martin & Odell: – With O-O technique the same paradigm is used for analysis, design & implementation. – The analyst identifies objects’ types & inheritance & think about the events that change the state of object. School of Computer Engineering, KIIT University 38
  • 39. – The designer adds details to this model perhaps designing screens, user interaction, and client- server interaction. – The thought process flows so naturally from 9.4.4 Corollary 4: Strong Mapping contd.. analyst to design that it may be difficult to tell where analysis ends and design begins. School of Computer Engineering, KIIT University 39
  • 40. 9.4.5 Corollary 5: Standardization • To reuse one should have good understanding of classes in OOP environment. • Most OOP such as Smalltalk, Java, C++, or PowerBuilder come with built-in class libraries. PowerBuilder come with built-in class libraries. • O-O systems grow as you create new applications. • The knowledge of existing class will help in reuse by inheriting from the existing class libraries. School of Computer Engineering, KIIT University 40
  • 41. Some shortfall: • However class libraries are not always well documented and updated. • Class libraries should be easily searched based 9.4.5 Corollary 5: Standardization contd.. • Class libraries should be easily searched based on user’s criteria. Solution: • Making a repository of Design Patterns can give some solutions to all these problems. School of Computer Engineering, KIIT University 41
  • 42. 9.4.6 Corollary 6: Designing with Inheritance • When you implement a class you have to determine its ancestor, along with: – What attributes it will have & – What messages it will understand. – What messages it will understand. • Then its methods & protocols are constructed. • Ideally you will choose inheritance to minimize the amount of program instructions. School of Computer Engineering, KIIT University 42
  • 43. • Issue here will be: – Achieving Multiple Inheritance in a Single Inheritance System. – Avoiding Inheriting Inappropriate Behaviors. 9.4.6 Corollary 6: Designing with Inheritance contd.. – Avoiding Inheriting Inappropriate Behaviors. • Eg: Developing an application for the government that manages the licensing procedure for a variety of regulated entities: • Like: License, Motor Vehicle, Private Vehicle, Commercial Vehicle, Restaurant, FoodTruck. School of Computer Engineering, KIIT University 43
  • 44. • The Initial Inheritance Design 9.4.6 Corollary 6: Designing with Inheritance contd.. School of Computer Engineering, KIIT University 44
  • 45. • The Single Inheritance Design Modified to Allow Licensing Food Trucks. 9.4.6 Corollary 6: Designing with Inheritance contd.. School of Computer Engineering, KIIT University 45
  • 46. • Alternately you can Modify the Single Inheritance Design to Allow Licensing Food Truck. 9.4.6 Corollary 6: Designing with Inheritance contd.. School of Computer Engineering, KIIT University 46
  • 47. • Multiple Inheritance Design of the System Structure 9.4.6 Corollary 6: Designing with Inheritance contd.. School of Computer Engineering, KIIT University 47
  • 48. • Design Patterns are devices: – that allows systems to share knowledge about their design, – by describing commonly recurring structures of 9.5 DESIGN PATTERNS (Eg:) – by describing commonly recurring structures of communicating components – that solve a general design problem within a particular context. • Documenting patterns is one way that allows reuse & sharing information of best practices. School of Computer Engineering, KIIT University 48
  • 49. Design Pattern example created by Kutotsuchi • Pattern Name: Facade • Rational & Motivation: This pattern can make the task of accessing a large number of 9.5 DESIGN PATTERNS (Eg:) contd.. the task of accessing a large number of modules much simpler by providing an additional interface layer. – This is done by creating a small collection of classes that have a single class that is used to access them, the FACADE. School of Computer Engineering, KIIT University 49
  • 50. • Classes: There can be any number of classes involved in this “facade” system, but – At least four or more classes are required: One client, the facade, & the classes underneath the 9.5 DESIGN PATTERNS (Eg:) contd.. client, the facade, & the classes underneath the facade. – A facade would be having limited coding most of the time making calls to lower layers. • Advantages: Using the facade to make the interfacing between many modules or classes. School of Computer Engineering, KIIT University 50
  • 51. • Disadvantages: We may loose some functionality contained in the lower level of classes, but this depends on how the facade was designed. 9.5 DESIGN PATTERNS (Eg:) contd.. was designed. • Example: Imagine there is a need to write a program that needs to represent a building as rooms that can be manipulated to interact with objects(windows, screens, projector, etc) in the room to change their state. School of Computer Engineering, KIIT University 51
  • 52. • Using a Design Pattern FAÇADE Eliminates the need for the client class to deal with a large number of classes. 9.5 DESIGN PATTERNS (Eg:) contd.. School of Computer Engineering, KIIT University 52
  • 53. • END of CHAPTER 9 • USE DESIGN PATTERNS IN YOUR O-O • USE DESIGN PATTERNS IN YOUR O-O SOFTWARE DESIGN School of Computer Engineering, KIIT University 53