Anupkumar M Bongale
Anupkumar M Bongale
object-oriented design
To show how the UML may be used to
Design evolution
Several different notations for describing
object-oriented designs were proposed in the
1980s and 1990s
The Unified Modeling Language is an
integration of these notations
It describes notations for a number of
modelling
Employee
name: string
address: string
dateOfBirth: Date
employeeNo: integer
socialSecurityNo: string
department: Dept
ma nager: Employee
salary: integer
status: {current, left, retired}
taxCode: integer
. ..
join ()
leave ()
retire ()
changeDetails ()
Conceptually, objects communicate by
message passing.
Messages
◦ The name of the service requested by the calling
object.
◦ Copies of the information required to execute the
service and the name of a holder for the result of
the service.
In practice, messages are often implemented
by procedure calls
◦ Name = procedure name.
◦ Information = parameter list.
// Call a method associated with a buffer
// object that returns the next value
// in the buffer
v = circularBuffer.Get () ;
Ma nager Programmer
budgetsControlled project
progLanguage
dateAppointed
The area computer validates the collected data and integrates it with the
data from different sources. The integrated data is archived and, using data
from this archive and a digitised map database a set of local weather maps
is created. Maps may be printed for distribution on a special-purpose map
printer or may be displayed in a number of different formats.
A weather station is a package of software controlled instruments
which collects data, performs some data processing and transmits
this data for further processing. The instruments include air and
ground thermometers, an anemometer, a wind vane, a barometer
and a rain gauge. Data is collected every five minutes.
Observer Satellite
User Ma p
Co mms interface display
Weather Ma p
Balloon Ma p printer
station
«subsystem» «subsystem»
Da ta processing Da ta archiving
Da ta
Da ta Da ta storage
checking integration
Ma p store Da ta store
Startup
Shutdown
Re port
Ca librate
Test
System Weather station
Use-case Report
Actors Weather data collection system, Weather station
Data The weather station sends a summary of the weather data that has been
collected from the instruments in the collection period to the weather data
collection system. The data sent are the maximum minimum and average
ground and air temperatures, the maximum, minimum and average air
pressures, the maximum, minimum and average wind speeds, the total
rainfall and the wind direction as sampled at 5 minute intervals.
Stimulus The weather data collection system establishes a modem link with the
weather station and requests transmission of the data.
Response The summarised data is sent to the weather data collection system
Comments Weather stations are usually asked to report once per hour but this
frequency may differ from one station to the other and may be modified in
future.
Once interactions between the system and its
environment have been understood, you use
this information for designing the system
architecture
Layered architecture is appropriate for the
weather station
◦ Interface layer for handling communications
◦ Data collection layer for managing instruments
◦ Instruments layer for collecting data
There should be no more than 7 entities in an
architectural model
Weather station
Manages all
«subsystem» external
Interface communications
Collects and
«subsystem» summarises
Da ta collection weather data
«subsystem» Package of
instruments for raw
Instruments data collections
Identifying objects (or object classes) is the
most difficult part of object oriented design
Instrument
WeatherStation Status
«subsystem»
Instruments
Air
thermometer Ra inGauge Anemometer
Ground
thermometer Barometer Wind Vane
Sequence models show the sequence of
object interactions that take place
◦ Objects are arranged horizontally across the top
◦ Time is represented vertically so models are read
top to bottom
◦ Interactions are represented by labelled arrows,
Different styles of arrow represent different types
of interaction
◦ A thin rectangle in an object lifeline represents the
time when the object is the controlling object in the
system
:CommsController :WeatherStation :WeatherData
request (report)
acknowledge ()
report ()
summarise ()
send (report)
reply (report)
acknowledge ()
Show how objects respond to different service
requests and the state transitions triggered by
these requests
◦ If object state is Shutdown then it responds to a Startup()
message
◦ In the waiting state the object is waiting for further
messages
◦ If reportWeather () then system moves to summarising
state
◦ If calibrate () the system moves to a calibrating state
◦ A collecting state is entered when a clock signal is
received
Operation calibrate () Calibrating
calibration OK
startup () Waiting test () Testing
Shutdown
Transmitting
clock collection
done reportWeather ()
weather summary
Summarising complete
Collecting
Hiding information inside objects means that
changes made to an object do not affect other
objects in an unpredictable way
Assume pollution monitoring facilities are to be
added to weather stations. These sample the
air and compute the amount of different
pollutants in the atmosphere
Pollution readings are transmitted with weather
data
Add an object class called ‘Air quality’ as part
of WeatherStation
Add an operation reportAirQuality to
monitoring instruments
WeatherStation
Air quality
identifier
NO Data
reportWeather () smokeData
reportAirQuality () benzeneData
calibrate (instruments)
test () collect ()
startup (instruments) summarise ()
shutdown (instruments)
NO meter SmokeMeter
BenzeneMeter
OOD is an approach to design so that design
components have their own private state and
operations
Objects should have constructor and
inspection operations. They provide services
to other objects
Objects may be implemented sequentially or
concurrently
The Unified Modeling Language provides
different notations for defining different
object models
A range of different models may be produced
during an object-oriented design process.
These include static and dynamic system
models
Object interfaces should be defined precisely
evolution