AN OVERVIEW OF OBJECT ORIENTED DESIGN HEURISTICS - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

AN OVERVIEW OF OBJECT ORIENTED DESIGN HEURISTICS

Description:

TOAD (Teaching Object-Oriented Analysis and Design) Heuristics ... TOAD Heuristics. Heuristic: Inheritance hierarchy root should be abstract. NewStudent ... – PowerPoint PPT presentation

Number of Views:111
Avg rating:3.0/5.0
Slides: 28
Provided by: ens0
Category:

less

Transcript and Presenter's Notes

Title: AN OVERVIEW OF OBJECT ORIENTED DESIGN HEURISTICS


1
AN OVERVIEW OF OBJECT ORIENTED DESIGN HEURISTICS
  • M.Sc Thesis
  • Author Muhammad K. Bashar Molla
  • Email ens03mbr_at_cs.umu.se
  • Supervisor Jurgen Börstler
  • Email jubo_at_cs.umu.se

2
Agenda
  • Introduction
  • Object Oriented Concepts
  • Support For Object Oriented Design
  • Existing Heuristics Design Models
  • Relationship Between Heuristics Patterns
  • Comparison of Heuristics
  • Conflicting Heuristics
  • Discussion

3
Introduction
  • What is Heuristic
  • Why Heuristics
  • How to collect Heuristics

4
Object Oriented Concepts
  • Object
  • Class
  • Inheritance
  • Polymorphism
  • Data abstraction Information hiding
  • Encapsulation
  • ...

5
Support For OO Design
General Specfic
Methods Principles/Guidelines Heuristics/Rule
s OO Design Patterns
Process level (Design Process) Concrete
Design Problem
6
Support For OO Design
Software Development Methods
OO Design Principles OO Design Patterns
OOD Heuristics Riel TOAD MeTHOOD Meyers ...
Object Oriented Design
7
Existing Heuristics Design Models
  • Riels Heuristics
  • TOAD (Teaching Object-Oriented Analysis and
    Design) Heuristics
  • MeTHOOD (Measures, Transformation Rules, and
    Heuristics for Object-Oriented Design) Heuristics
  • Meyers Heuristics

8
Existing Heuristics Design Models
Riels Heuristics Categories
  • Class and Object (11 Heuristics)
  • GOD Class (10 Heuristics)
  • Different relationship (37 Heuristics)
  • Class-specific and data behaviour (1 Heuristic)
  • Physical Object-Oriented Design (2 Heuristics)

9
Riels Heuristics
Heuristic Users of a class must be dependent on
its public interface, but a class should not be
dependent on its users
AnAlarmClock
ATimeClockSafe
AnAlarmClock
Person
John Umeå
CurrentTime 1140 AlarmTime 1230 AlarmStatus on
AlarmTime 0745 Meeting
CurrentTime 0515 AlarmTime 0745 AlarmStatus off
alarm_on()
alarm_off()
10
Existing Heuristics Design Models
Riels Heuristics Categories
  • Class and Object
  • GOD Class (10 Heuristics)
  • Different relationship (37 Heuristics)
  • Class-specific and data behaviour (1 Heuristic)
  • Physical Object-Oriented Design (2 Heuristics)

11
Riels Heuristics
Heuristic Do not create god class/object in your
system
desired_temp? ()
Desired Temp
actual_temp? ()
HeatFlowRegulator
Furnace
Actual Temp
Occupancy
any_one_in_room? ()
Room
get_desired_temp ()
Desired Temp
get_actual_temp ()
HeatFlowRegulator
Furnace
Actual Temp
is_occupied ()
Occupancy
Room
do_you_need_heat? ()
Desired Temp
HeatFlowRegulator
Furnace
Actual Temp
Occupancy
12
Existing Heuristics Design Models
Riels Heuristics Categories
  • Class and Object
  • GOD Class
  • Different relationship (37 Heuristics)
  • Class-specific and data behaviour (1 Heuristic)
  • Physical Object-Oriented Design (2 Heuristics)

13
Riels Heuristics
Heuristic Minimize the number of classes with
which another class collaborates
Meal
Melon
cost ()
Melon
cost ()
cost ()
Restaurant Patron
Steak
Resturant Patron
Steak
cost ()
Pie
Pie
14
Existing Heuristics Design Models
Riels Heuristics Categories
  • Class and Object
  • GOD Class
  • Different relationship (37 Heuristics)
    continue...
  • Class-specific and data behaviour (1 Heuristic)
  • Physical Object-Oriented Design (2 Heuristics)

15
Riels Heuristics
Heuristic Do not confuse optional containment
with the need for inheritance, modeling optional
containment with inheritance will lead to a
proliferation of classes.
House
etc...
HeatingHouse
CoolingHouse
ElectricalHouse
HeatingCoolinhHouse
HeatingHouse
CoolingHouse
House
ElectricalHouse
etc...
16
Existing Heuristics Design Models
  • Riels Heuristics
  • TOAD (Teaching Object-Oriented Analysis and
    Design) Heuristics
  • MeTHOOD (Measures, Transformation Rules, and
    Heuristics for Object-Oriented Design) Heuristics
  • Meyers Heuristics

17
TOAD Heuristics
Heuristic Inheritance hierarchy root should be
abstract.
NewStudent Name ID Course ()
FullStudent AccessCard LBCard
FullStudent AccessCard LBCard
Student Name ID Course ()
NewStudent Name ID Course ()
18
Existing Heuristics Design Models
  • Riels Heuristics
  • TOAD (Teaching Object-Oriented Analysis and
    Design) Heuristics
  • MeTHOOD (Measures, Transformation Rules, and
    Heuristics for Object-Oriented Design) Heuristics
  • Meyers Heuristics

19
MeTHOOD Heuristics
Heuristic A class should capture one and only one
key abstraction with all its information and all
its behavior.
StudentProfile ID Name Address Result
20
Exixting Heuristics Design Models
  • Riels Heuristics
  • TOAD (Teaching Object-Oriented Analysis and
    Design) Heuristics
  • MeTHOOD (Measures, Transformation Rules, and
    Heuristics for Object-Oriented Design) Heuristics
  • Meyers Heuristics

21
Relationship Between Heuristics Patterns
  • Singleton Pattern
  • Observer Pattern
  • ...
  • Do not create god classes/objects in your system
  • Minimize the number of classes with which another
    class collaborates
  • ...

22
Comparison of Heuristics
23
Comparison of Heuristics
Most Similar Heuristics
24
Conflicting Heuristics
Heuristic All base class should be abstract
Heuristic Eliminate irrelevant classes from your
design
Heuristic Do not exclude behavior from
subclasses
Bird move ( ) ...
Bird fly ( ) ...
Do not exclude behaviour from subclass
move ( )
Penguin fly ( ) no op
FlyingBird fly ( ) ... move ( )
Penguin swim ( ) ... move ( )
Eliminate irrelavent classes from your design
25
Discussion
  • No summary or conclusion ? So...
  • Need more heuristics. How to ?
  • Express your heuristics.

26
Thanks
27
Question???
Write a Comment
User Comments (0)
About PowerShow.com