Title: Object-Oriented Development
1Object-Oriented Development
By Grady Booch
2Abstract
- Object-oriented development is a
partial-lifecycle software development method
which the decomposition of a system is based on
the concept of an object - This method is fundamentally different than
Traditional functional approaches to design
3Abstract continues
- Serves to help manage the complexity of massive
software-intensive systems
4Introduction
- Object-oriented programming is what structured
programming was in 1970s - Object-oriented approach to software design in
which the decomposition of a system is based upon
the concept on an object
5Continued
- An object is an entity whose behavior is
characterized by the action that it suffers and
that requires of other objects - Object oriented development is different than
traditional functional methods
6Functional method
- Fortran, Cobol, Pascal
- Each module represents a major step in the
overall process - Tend to consist of collections of programs,
because they are the only building blocks
available
7Continued
- Subroutines are not well suited to the
description of abstract objects. This is a
serious drawback
8Object-oriented method
- Ada and Smalltalk
- subprogram as an elementary building block
- In Ada, Package and task are major elements
- Package is used to create new objects and classes
of objects
9Continued
- Task express concurrent objects and activities in
a natural way - Package and subprograms help to better build
abstraction of the problem space by permitting a
more balanced treatment between nouns and verbs
10Nouns and Verbs
- Nouns are objects
- Verbs are operations
11functional method Limitations
- Do not effectively address data abstraction and
information hiding - Generally inadequate for problem domains with
natural concurrency - Often not responsive to changes in the problem
space - OO approach mitigate these problems
12A cruise control design
- Inputs to the system
- System on/off
- If on, cruise control maintains the speed
- Engine on/off
- Cruise control only active if engine is on
- Pulse from wheel
- One pulse for every revolution
- Accelerator
- How far it has been pressed
13Continued
- Brake
- when pressed, cruise control is turned off
- Increase/Decrease Speed
- If only the cruise control system is on
- Resume
- Resume the last maintained speed
- Clock
- Timing pulse every millisecond
14Continued
- Output from the system
- Throttle
- Digital value for the engine throttle setting
15Cruise Control Hardware Block Diagram
System on/off
Engine on/off
Pulse from Wheel
Cruise- Control System
Accelerator
Throttle
Brake
Increase/decrease speed
Resume speed
Clock
16Pulse
Wheel
Calculate Current Speed
Current speed
Current speed
Clock tick
Clock
On/Off
Calculate Desired Speed
Driver
Desired speed
Desired speed
Incr/Decr
Resume
Set Brake State
Brake State
Brake
Brake State
On/Off
Brake State
On/Off
Engine
Calculate Throttle Setting
Desired speed
Value
Current Speed
Throttle Setting
Accel
Throttle
Throttle Setting
17Cruise Control System
Get Desired Speed
Get Current Speed
Get Brake State
Calculate Throttle Setting
Put Throttle Value
Functional Decomposition
18Wheel
Clock
Driver
Current Speed
Brake
Desired Speed
Engine
Throttle
Object Oriented Decomposition
Accelerator
19Object-Oriented Development
- Major steps in Object-oriented development
- Identify the objects and their attributes
- Identify the operations suffered by and required
of each object - Establish the visibility of each object in
relation to other objects - Establish the interface of each object
- Implement each object
20Identify the objects and their attributes
- Recognition of major actors, agents, and servers
in the problem space plus their role in our model
of reality - The objects identify is this step derive from the
nouns used in describing the problem space - Establish classes of objects for similar objects
21Identify the operations suffered by and required
of each object
- Serves to characterize the behavior of each
object or class of objects - Establish the static semantics of the object by
determining the operations that may be
meaningfully performed on the object of objects - Establish the dynamic behavior of object by
identifying the constraints upon time or space
that must be observed
22Establish the visibility of each object in
relation to other objects
- We identify the static dependencies among objects
and classes of objects - In other words, what objects see and are seen by
a given objects - The purpose of this step is to capture the
topology of objects from our model of reality
23Establish the interface of each object
- Produce a module specification, using some
suitable notation (Ada, Smalltalk, etc, ) - This captures the static semantics of each object
or class of objects that we established in
previous step - This specification serves as a contract between
the clients of an object and the object itself - In other words, the interface forms the boundary
between the outside view and the inside view of
an object
24Implement each object
- Involves choosing a suitable representation for
each object or class of objects - Implementing the interface from previous step
- Involves decomposition or composition if an
object is found to consist of several objects - In this case we repeat our method to further
decompose the object
25Useful points
- Object-oriented development is a
partial-lifecycle method - It focuses upon the design and implementation
stages of software development - It is necessary to couple object-oriented
development with appropriate requirements and
analysis methods in order to help create or model
of reality
26Major Goals in developing object Based software
- To reduce the total life-cycle software cost by
increasing programmer productivity and reducing
maintenance cost - Implement software system that resist both
accidental and malicious corruption attempts
27Properties of an Object
- Object is an entity that
- Has state
- Is characterized by the actions that it suffers
and that it requires of other objects - Is an instance of some class
- Is denoted by a name
- Has restricted visibility of and by other objects
- May be viewed either by its specification or by
its implementation
28Object Classification
- Actor
- Suffers no operation but only operates upon other
objects - Agent
- Serves to perform some operation on behalf of
another object and in turn may operate upon
another object - Server
- Suffers operation and may not operate upon other
objects
29Class
- An object is a unique instance of some class
- A class denotes a set of similar but unique
objects - Class serves to factor the common properties of a
set of objects and specify the behavior of all
instances
30Inheritance
- Permits a hierarchy of classes
- All objects are an instance of a class, which is
a subclass of another class (and so on) - Subclass has the same operations defined by the
superclass - May also add operation, modify existing
operation, and hide operation from the superclass
31Two views to each Objects
- Outside View
- Serves to capture the abstract behavior of the
object - An object can interact with other objects by just
knowing its outside view - Implementation does not need to be present for
interaction with the object - Inside View
- Indicates how the behavior is implemented and it
is hidden form other objects
32Ada and Object-Oriented Development
- Classes of objects are denoted by packages that
export private or limited private types - Objects are denoted by instances of private or
limited private types or as packages that serve
as abstract state machined - Objects state resides either with a declared
object or in the body of a package
33Continued
- Operations are implemented as subprograms
exported from a package specification generic
formal subprogram parameters serve to specify the
operations required by an object - Visibility is statistically defined through unit
context clauses - Separate compilation of package specification and
body support the tow views of an object - Tasks and task types may be used to denote actor
objects and classes of objects
34Name_X
Name_Y
Name_B
Object
Object
Name_A
Package
Type
Object
Operation
Operation
Names, Objects and Classes Interaction of the
points in the previous slide
35Symbols of OOD
Generic Subprogram
Task
Subsystem
Generic Package
Subprogram
Package
Object
36- These symbols can be connected by a direct line
- A line connects object A to B, this denotes
object A depends on object B
37Design Case Study
- A collection of free-floating Buoys
- Buoys collect air and water temperature
- Collect wind speed
- Collect location data through variety of sensors
- Each equipped with a radio transmitter to
broadcast weather and location in formation as
well as an SOS message - Each equipped with a radio receiver to receive
requests from passing vessels
38- Some equipped with a red light, which may be
activated by vessel during a sea-search
operations - If a sailor is able to reach the buoy, he or she
may flip a switch on the side to initiate an SOS
broadcast
39 40Software Requirements
- Maintain current current wind temperature, and
location in formation wind speed readings are
taken every 30 seconds temperature readings
every 10 seconds and location every 10 seconds
wind and temperature wind and temperature values
kept as a running average - Broadcast current wind, temperature and location
information every 60 seconds
41- Broadcast wind, temperature, and location
information from the past 24 hours in response to
requests from passing vessels - Activate or deactivate the red light based on a
request from a passing vessel - Continuously broadcast an SOS signal after a
sailor engages the emergency switch this takes
priority over all other broadcast and continues
until reset by a passing vessel
42Pulse
Clock
Location Sensor
Water Temp Sensor
Air Temp Sensor
Wind Speed Sensor
Value
Value
Value
Value
Calculate Location
Calculate Average
Calculate Average
Calculate Average
Pulse
Avg. value
Avg. value
value
Avg. value
Sensor Data Bases
Radio Receiver
Broadcast Message
Request
Wind/Location Data
Radio Transmitter
SOS Message
State
Set Light State
SOS Request
Emergency Switch
State
Red Light
Host at see Buoy data flow diagram
43Objects
- Clock
- Provides the stimulus for periodic actions
- Wind Speed sensor
- Maintains a running average of wind speed
- Air Temperature Sensor
- Maintains a running average of air temperature
- Water Temperature Sensor
- Maintains a running avg. of water temperature
- Location Sensor
- Maintains the current buoy location
- Sensor Database
- Serves to store weather and location history
44- Radio Receiver
- Provides a channel for requests from passing
vessels - Radio Transmitter
- Provides a channel for broad cast of weather and
location reports as well as SOS messages - Emergency Switch
- Provides the stimulus for the SOS signal
- Red Light
- Controls the activity of the emergency light
- Message Switch
- Serves to generate and arbitrate various
broadcast messages
45Clock
Air Temp Sensor
Wind Speed Sensor
Water Temp Sensor
Location Sensor
Sensor Data Base
Radio Receiver
Radio Transmitter
Message Switch
Red Light
Host at see buoy objects
Emergency Switch
46Operations Suffered by an Object
- Clock
- None
- Wind Speed Sensors
- Take Sample
- Air Temperature Sensors
- Take Sample
- Water Temperature Sensors
- Take Sample
- Location Sensor
- Take Sample
47- Sensor Database
- Put value
- Get value
- Radio Receiver
- None
- Radio Transmitter
- Broadcast SOS
- Broadcast Weather/Location report
48- Emergency Switch
- None
- Red Light
- Set State
- Message Switch
- Request History Report
- Request SOS
49Operations Required from an Object
- Clock
- Force Sample
- Force Periodic Report
- Wind Speed Sensors
- Put Value
- Air Temperature Sensors
- Put Value
- Water Temperature Sensors
- Put Value
- Location Sensor
- Put Value
50- Sensor Database
- None
- Radio Receiver
- Force History Report
- Set Light State
- Radio Transmitter
- None
51- Emergency Switch
- Force SOS
- Red Light
- None
- Message Switch
- Send Weather/Location Report
- Send SOS
- NOTE There is a balance between the operations
suffered by and required of all objects. For
each operation suffered by an object, we have
other object or set of objects that require that
action
52Ada Representation
- generic
- type value is digits lt gt
- with procedure Put_Value (The_Value in Value)
- package Air_Temperature_Sensors is
- type Sensor is limited private
- procedure Take_Sample (The_Sensor in out
Sensor) - private
- type Sensor is
- end Air_Temperature_Sensors
53Clock
Location Sensor
Water Temp Sensors
Wind peed Sensors
Air Temp Sensors
Sensor Data Base
Message Switch
Radio Transmitter
Radio Receiver
Reports
Emergency Switch
Red light
Host at see buoy objects
54Conclusion
- The greatest strength of an object-oriented
approach to development is that it offers a
mechanism that captures a model of the real
world. - This leads to improved maintainability and
understandability of systems whose complexity
exceeds the intellectual capacity of a single
developer or a team of developers