SlideShare une entreprise Scribd logo
1  sur  56
12/07/15 1www.prsolutions08.blogspot.com
Object-oriented DesignObject-oriented Design
12/07/15 2
www.prsolutions08.blogspot.com
ObjectivesObjectives
 To explain how a software design may beTo explain how a software design may be
represented as a set of interacting objects thatrepresented as a set of interacting objects that
manage their own state and operationsmanage their own state and operations
 To describe the activities in the object-orientedTo describe the activities in the object-oriented
design processdesign process
 To introduce various models that can be used toTo introduce various models that can be used to
describe an object-oriented designdescribe an object-oriented design
 To show how the UML may be used toTo show how the UML may be used to
represent these modelsrepresent these models
12/07/15 3
www.prsolutions08.blogspot.com
Topics coveredTopics covered
 Objects and object classesObjects and object classes
 An object-oriented design processAn object-oriented design process
 Design evolutionDesign evolution
12/07/15 4
www.prsolutions08.blogspot.com
Object-oriented developmentObject-oriented development
 Object-oriented analysis, design and programming areObject-oriented analysis, design and programming are
related but distinct.related but distinct.
 OOA is concerned with developing an object model ofOOA is concerned with developing an object model of
the application domain.the application domain.
 OOD is concerned with developing an object-orientedOOD is concerned with developing an object-oriented
system model to implement requirements.system model to implement requirements.
 OOP is concerned with realising an OOD using an OOOOP is concerned with realising an OOD using an OO
programming language such as Java or C++.programming language such as Java or C++.
12/07/15 5
www.prsolutions08.blogspot.com
Characteristics of OODCharacteristics of OOD
 Objects are abstractions of real-world or system entitiesObjects are abstractions of real-world or system entities
and manage themselves.and manage themselves.
 Objects are independent and encapsulate state andObjects are independent and encapsulate state and
representation information.representation information.
 System functionality is expressed in terms of objectSystem functionality is expressed in terms of object
services.services.
 Shared data areas are eliminated. ObjectsShared data areas are eliminated. Objects
communicate by message passing.communicate by message passing.
 Objects may be distributed and may executeObjects may be distributed and may execute
sequentially or in parallel.sequentially or in parallel.
12/07/15 6www.prsolutions08.blogspot.com
Interacting objectsInteracting objects
state o3
o3:C3
state o4
o4: C4
state o1
o1: C1
state o6
o6: C1
state o5
o5:C5
state o2
o2: C3
ops1() ops3 () ops4 ()
ops3 () ops1 () ops5 ()
12/07/15 7www.prsolutions08.blogspot.com
Advantages of OODAdvantages of OOD
 Easier maintenance. Objects may beEasier maintenance. Objects may be
understood as stand-alone entities.understood as stand-alone entities.
 Objects are potentially reusable components.Objects are potentially reusable components.
 For some systems, there may be an obviousFor some systems, there may be an obvious
mapping from real world entities to systemmapping from real world entities to system
objects.objects.
12/07/15 8www.prsolutions08.blogspot.com
Objects and object classesObjects and object classes
 Objects are entities in a software system whichObjects are entities in a software system which
represent instances of real-world and systemrepresent instances of real-world and system
entities.entities.
 Object classes are templates for objects. TheyObject classes are templates for objects. They
may be used to create objects.may be used to create objects.
 Object classes may inherit attributes and servicesObject classes may inherit attributes and services
from other object classes.from other object classes.
12/07/15 9www.prsolutions08.blogspot.com
Objects and object classesObjects and object classes
An object is an entity that has a state and a defined set of
operations which operate on that state. The state is represented as
a set of object attributes. The operations associated with the object
provide services to other objects (clients) which request these
services when some computation is required.
Objects are created according to some object class definition. An
object class definition serves as a template for objects. It includes
declarations of all the attributes and services which should be
associated with an object of that class.
12/07/15 10www.prsolutions08.blogspot.com
The Unified Modeling LanguageThe Unified Modeling Language
 Several different notations for describing object-Several different notations for describing object-
oriented designs were proposed in the 1980s and 1990s.oriented designs were proposed in the 1980s and 1990s.
 The Unified Modeling Language is an integration ofThe Unified Modeling Language is an integration of
these notations.these notations.
 It describes notations for a number of different modelsIt describes notations for a number of different models
that may be produced during OO analysis and design.that may be produced during OO analysis and design.
 It is now aIt is now a de factode facto standard for OO modelling.standard for OO modelling.
12/07/15 11S.Sreenivasa Rao
Employee object class (UML)Employee object class (UML)
Emplo yee
name: string
address: string
dateOfBir th: Date
employeeNo: integer
socialSecurityNo: string
depar tment: Dept
manager: Employee
salar y: integer
status: {current, left, retired}
taxCode: integer
. ..
join ()
leave ()
retire ()
changeDetails ()
12/07/15 12S.Sreenivasa Rao
Object communicationObject communication
 Conceptually, objects communicate byConceptually, objects communicate by
message passing.message passing.
 MessagesMessages
 The name of the service requested by the calling object;The name of the service requested by the calling object;
 Copies of the information required to execute the serviceCopies of the information required to execute the service
and the name of a holder for the result of the service.and the name of a holder for the result of the service.
 In practice, messages are often implementedIn practice, messages are often implemented
by procedure callsby procedure calls
 Name = procedure name;Name = procedure name;
 Information = parameter list.Information = parameter list.
12/07/15 13www.prsolutions08.blogspot.com
Message examplesMessage examples
// Call a method associated with a buffer// Call a method associated with a buffer
// object that returns the next value// object that returns the next value
// in the buffer// in the buffer
v = circularBuffer.Get () ;v = circularBuffer.Get () ;
// Call the method associated with a// Call the method associated with a
// thermostat object that sets the// thermostat object that sets the
// temperature to be maintained// temperature to be maintained
thermostat.setTemp (20) ;thermostat.setTemp (20) ;
12/07/15 14www.prsolutions08.blogspot.com
Generalisation and inheritanceGeneralisation and inheritance
 Objects are members of classes that defineObjects are members of classes that define
attribute types and operations.attribute types and operations.
 Classes may be arranged in a class hierarchyClasses may be arranged in a class hierarchy
where one class (a super-class) is a generalisation of onewhere one class (a super-class) is a generalisation of one
or more other classes (sub-classes).or more other classes (sub-classes).
 A sub-class inherits the attributes andA sub-class inherits the attributes and
operations from its super class and may addoperations from its super class and may add
new methods or attributes of its own.new methods or attributes of its own.
 Generalisation in the UML is implemented asGeneralisation in the UML is implemented as
inheritance in OO programming languages.inheritance in OO programming languages.
12/07/15 15www.prsolutions08.blogspot.com
A generalisation hierarchyA generalisation hierarchy
Employee
Programmer
project
progLanguages
Mana ger
Project
Mana ger
budgetsControlled
dateAppointed
projects
Dept.
Mana ger
Strateg ic
Mana ger
dept responsibilities
12/07/15 16www.prsolutions08.blogspot.com
Advantages of inheritanceAdvantages of inheritance
 It is an abstraction mechanism which may beIt is an abstraction mechanism which may be
used to classify entities.used to classify entities.
 It is a reuse mechanism at both the design andIt is a reuse mechanism at both the design and
the programming level.the programming level.
 The inheritance graph is a source ofThe inheritance graph is a source of
organisational knowledge about domains andorganisational knowledge about domains and
systems.systems.
12/07/15 17www.prsolutions08.blogspot.com
Problems with inheritanceProblems with inheritance
 Object classes are not self-contained. theyObject classes are not self-contained. they
cannot be understood without reference to theircannot be understood without reference to their
super-classes.super-classes.
 Designers have a tendency to reuse theDesigners have a tendency to reuse the
inheritance graph created during analysis. Caninheritance graph created during analysis. Can
lead to significant inefficiency.lead to significant inefficiency.
 The inheritance graphs of analysis, design andThe inheritance graphs of analysis, design and
implementation have different functions andimplementation have different functions and
should be separately maintained.should be separately maintained.
12/07/15 18www.prsolutions08.blogspot.com
UML associationsUML associations
 Objects and object classes participate in relationshipsObjects and object classes participate in relationships
with other objects and object classes.with other objects and object classes.
 In the UML, a generalised relationship is indicated byIn the UML, a generalised relationship is indicated by
an association.an association.
 Associations may be annotated with information thatAssociations may be annotated with information that
describes the association.describes the association.
 Associations are general but may indicate that anAssociations are general but may indicate that an
attribute of an object is an associated object or that aattribute of an object is an associated object or that a
method relies on an associated object.method relies on an associated object.
12/07/15 19www.prsolutions08.blogspot.com
An association modelAn association model
Employee Depar tment
Manager
is-member-of
is-managed-by
manages
12/07/15 20www.prsolutions08.blogspot.com
Concurrent objectsConcurrent objects
 The nature of objects as self-contained entitiesThe nature of objects as self-contained entities
make them suitable for concurrentmake them suitable for concurrent
implementation.implementation.
 The message-passing model of objectThe message-passing model of object
communication can be implemented directly ifcommunication can be implemented directly if
objects are running on separate processors in aobjects are running on separate processors in a
distributed system.distributed system.
12/07/15 21www.prsolutions08.blogspot.com
Servers and active objectsServers and active objects
 Servers.Servers.
 The object is implemented as a parallel process (server)The object is implemented as a parallel process (server)
with entry points corresponding to object operations. If nowith entry points corresponding to object operations. If no
calls are made to it, the object suspends itself and waits forcalls are made to it, the object suspends itself and waits for
further requests for service.further requests for service.
 Active objectsActive objects
 Objects are implemented as parallel processes and theObjects are implemented as parallel processes and the
internal object state may be changed by the object itself andinternal object state may be changed by the object itself and
not simply by external calls.not simply by external calls.
12/07/15 22www.prsolutions08.blogspot.com
Active transponder objectActive transponder object
 Active objects may have their attributesActive objects may have their attributes
modified by operations but may also updatemodified by operations but may also update
them autonomously using internal operations.them autonomously using internal operations.
 AA TransponderTransponder object broadcasts an aircraft’sobject broadcasts an aircraft’s
position. The position may be updated using aposition. The position may be updated using a
satellite positioning system. The objectsatellite positioning system. The object
periodically update the position by triangulationperiodically update the position by triangulation
from satellites.from satellites.
12/07/15 23www.prsolutions08.blogspot.com
An active transponder objectAn active transponder object
class Transponder extends Thread {
Position currentPosition ;
Coords c1, c2 ;
Satellite sat1, sat2 ;
Navigator theNavigator ;
public Position givePosition ()
{
return currentPosition ;
}
public void run ()
{
while (true)
{
c1 = sat1.position () ;
c2 = sat2.position () ;
currentPosition = theNavigator.compute (c1, c2) ;
}
}
} //Transponder
12/07/15 24www.prsolutions08.blogspot.com
Java threadsJava threads
 Threads in Java are a simple construct forThreads in Java are a simple construct for
implementing concurrent objects.implementing concurrent objects.
 Threads must include a method called run() andThreads must include a method called run() and
this is started up by the Java run-time system.this is started up by the Java run-time system.
 Active objects typically include an infinite loopActive objects typically include an infinite loop
so that they are always carrying out theso that they are always carrying out the
computation.computation.
12/07/15 25www.prsolutions08.blogspot.com
An object-oriented designAn object-oriented design
processprocess
 Structured design processes involve developing aStructured design processes involve developing a
number of different system models.number of different system models.
 They require a lot of effort for development andThey require a lot of effort for development and
maintenance of these models and, for smallmaintenance of these models and, for small
systems, this may not be cost-effective.systems, this may not be cost-effective.
 However, for large systems developed byHowever, for large systems developed by
different groups design models are an essentialdifferent groups design models are an essential
communication mechanism.communication mechanism.
12/07/15 26www.prsolutions08.blogspot.com
Process stagesProcess stages
 Highlights key activities without being tied toHighlights key activities without being tied to
any proprietary process such as the RUP.any proprietary process such as the RUP.
 Define the context and modes of use of the system;Define the context and modes of use of the system;
 Design the system architecture;Design the system architecture;
 Identify the principal system objects;Identify the principal system objects;
 Develop design models;Develop design models;
 Specify object interfaces.Specify object interfaces.
12/07/15 27www.prsolutions08.blogspot.com
Weather system descriptionWeather system description
A weather mapping system is required to generate weather maps on a
regular basis using data collected from remote, unattended weather stations
and other data sources such as weather observers, balloons and satellites.
Weather stations transmit their data to the area computer in response to a
request from that machine.
The area computer system 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.
12/07/15 28www.prsolutions08.blogspot.com
System context and models of useSystem context and models of use
 Develop an understanding of the relationships betweenDevelop an understanding of the relationships between
the software being designed and its externalthe software being designed and its external
environmentenvironment
 System contextSystem context
 A static model that describes other systems in theA static model that describes other systems in the
environment. Use a subsystem model to show other systems.environment. Use a subsystem model to show other systems.
Following slide shows the systems around the weather stationFollowing slide shows the systems around the weather station
system.system.
 Model of system useModel of system use
 A dynamic model that describes how the system interactsA dynamic model that describes how the system interacts
with its environment. Use use-cases to show interactionswith its environment. Use use-cases to show interactions
12/07/15 29www.prsolutions08.blogspot.com
Layered architectureLayered architecture
« subsystem»
Data collection
« subsystem»
Data processing
« subsystem»
Data archiving
« subsystem»
Data display
Data collection layer where objects
are concerned with acquiring data
from remote sources
Data processing layer where objects
are concerned with checking and
integ rating the collected data
Data archiving layer where objects
are concerned with storing the data
for future processing
Data display layer where objects are
concerned with preparing and
presenting the data in a human-
readable form
12/07/15 30www.prsolutions08.blogspot.com
Subsystems in the weather mapping systemSubsystems in the weather mapping system
Data
storage
User
inter face
« subsystem»
Data collection
« subsystem»
Data processing
« subsystem»
Data archiving
« subsystem»
Data display
Weather
station
Satellite
Comms
Balloon
Observer
Map store Data store
Data
storage
Map
User
inter face
Map
display
Map
printer
Data
checking
Data
integ ration
12/07/15 31www.prsolutions08.blogspot.com
Use-case modelsUse-case models
 Use-case models are used to represent eachUse-case models are used to represent each
interaction with the system.interaction with the system.
 A use-case model shows the system features asA use-case model shows the system features as
ellipses and the interacting entity as a stickellipses and the interacting entity as a stick
figure.figure.
12/07/15 32www.prsolutions08.blogspot.com
Use-cases for the weather stationUse-cases for the weather station
Star tup
Shutdown
Repor t
Calibrate
Test
12/07/15 33www.prsolutions08.blogspot.com
Use-case descriptionUse-case description
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.
12/07/15 34www.prsolutions08.blogspot.com
Architectural designArchitectural design
 Once interactions between the system and itsOnce interactions between the system and its
environment have been understood, you use thisenvironment have been understood, you use this
information for designing the system architecture.information for designing the system architecture.
 A layered architecture as discussed in Chapter 11 isA layered architecture as discussed in Chapter 11 is
appropriate for the weather stationappropriate for the weather station
 Interface layer for handling communications;Interface layer for handling communications;
 Data collection layer for managing instruments;Data collection layer for managing instruments;
 Instruments layer for collecting data.Instruments layer for collecting data.
 There should normally be no more than 7 entities in anThere should normally be no more than 7 entities in an
architectural model.architectural model.
12/07/15 35www.prsolutions08.blogspot.com
Weather station architectureWeather station architecture
Weather station
Manages all
external
communications
Collects and
summarises
weather data
Package of
instruments for raw
data collections
« subsystem»
Data collection
« subsystem»
Instruments
« subsystem»
Interface
12/07/15 36www.prsolutions08.blogspot.com
Object identificationObject identification
 Identifying objects (or object classes) is the mostIdentifying objects (or object classes) is the most
difficult part of object oriented design.difficult part of object oriented design.
 There is no 'magic formula' for objectThere is no 'magic formula' for object
identification. It relies on the skill, experienceidentification. It relies on the skill, experience
and domain knowledge of system designers.and domain knowledge of system designers.
 Object identification is an iterative process. YouObject identification is an iterative process. You
are unlikely to get it right first time.are unlikely to get it right first time.
12/07/15 37www.prsolutions08.blogspot.com
Approaches to identificationApproaches to identification
 Use a grammatical approach based on a naturalUse a grammatical approach based on a natural
language description of the system (used in Hoodlanguage description of the system (used in Hood
OOD method).OOD method).
 Base the identification on tangible things in theBase the identification on tangible things in the
application domain.application domain.
 Use a behavioural approach and identify objects basedUse a behavioural approach and identify objects based
on what participates in what behaviour.on what participates in what behaviour.
 Use a scenario-based analysis. The objects, attributesUse a scenario-based analysis. The objects, attributes
and methods in each scenario are identified.and methods in each scenario are identified.
12/07/15 38www.prsolutions08.blogspot.com
Weather station descriptionWeather station description
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 periodically.
When a command is issued to transmit the weather data, the
weather station processes and summarises the collected data. The
summarised data is transmitted to the mapping computer when a
request is received.
12/07/15 39www.prsolutions08.blogspot.com
Weather station object classesWeather station object classes
 Ground thermometer, Anemometer, BarometerGround thermometer, Anemometer, Barometer
 Application domain objects that are ‘hardware’ objects relatedApplication domain objects that are ‘hardware’ objects related
to the instruments in the system.to the instruments in the system.
 Weather stationWeather station
 The basic interface of the weather station to its environment.The basic interface of the weather station to its environment.
It therefore reflects the interactions identified in the use-caseIt therefore reflects the interactions identified in the use-case
model.model.
 Weather dataWeather data
 Encapsulates the summarised data from the instruments.Encapsulates the summarised data from the instruments.
12/07/15 40www.prsolutions08.blogspot.com
Weather station object classesWeather station object classes
identifier
repor tWeather ()
calibrate (instruments)
test ()
star tup (instruments)
shutdown (instruments)
WeatherStation
test ()
calibrate ()
Ground
thermomet er
temper ature
Anemomet er
windSpeed
windDirection
test ()
Baromet er
pressure
height
test ()
calibrate ()
WeatherData
airTemper atures
groundT emper atures
windSpeeds
windDirections
pressures
rainfall
collect ()
summarise ()
12/07/15 41www.prsolutions08.blogspot.com
Further objects and object refinementFurther objects and object refinement
 Use domain knowledge to identify more objects andUse domain knowledge to identify more objects and
operationsoperations
 Weather stations should have a unique identifier;Weather stations should have a unique identifier;
 Weather stations are remotely situated so instrument failuresWeather stations are remotely situated so instrument failures
have to be reported automatically. Therefore attributes andhave to be reported automatically. Therefore attributes and
operations for self-checking are required.operations for self-checking are required.
 Active or passive objectsActive or passive objects
 In this case, objects are passive and collect data on requestIn this case, objects are passive and collect data on request
rather than autonomously. This introduces flexibility at therather than autonomously. This introduces flexibility at the
expense of controller processing time.expense of controller processing time.
12/07/15 42www.prsolutions08.blogspot.com
Design modelsDesign models
 Design models show the objects and objectDesign models show the objects and object
classes and relationships between these entities.classes and relationships between these entities.
 Static models describe the static structure of theStatic models describe the static structure of the
system in terms of object classes andsystem in terms of object classes and
relationships.relationships.
 Dynamic models describe the dynamicDynamic models describe the dynamic
interactions between objects.interactions between objects.
12/07/15 43S.Sreenivasa Rao
Examples of design modelsExamples of design models
 Sub-system models that show logical groupings ofSub-system models that show logical groupings of
objects into coherent subsystems.objects into coherent subsystems.
 Sequence models that show the sequence of objectSequence models that show the sequence of object
interactions.interactions.
 State machine models that show how individual objectsState machine models that show how individual objects
change their state in response to events.change their state in response to events.
 Other models include use-case models, aggregationOther models include use-case models, aggregation
models, generalisation models, etc.models, generalisation models, etc.
12/07/15 44S.Sreenivasa Rao
Subsystem modelsSubsystem models
 Shows how the design is organised into logicallyShows how the design is organised into logically
related groups of objects.related groups of objects.
 In the UML, these are shown using packages -In the UML, these are shown using packages -
an encapsulation construct. This is a logicalan encapsulation construct. This is a logical
model. The actual organisation of objects in themodel. The actual organisation of objects in the
system may be different.system may be different.
12/07/15 45S.Sreenivasa Rao
Weather station subsystemsWeather station subsystems
« subsystem»
Inter face
« subsystem»
Data collection
CommsController
WeatherStation
WeatherData
Instrument
Status
« subsystem»
Instruments
Air
thermometer
Ground
thermometer
RainGauge
Barometer
Anemometer
WindVane
12/07/15 46S.Sreenivasa Rao
Sequence modelsSequence models
 Sequence models show the sequence of objectSequence models show the sequence of object
interactions that take placeinteractions that take place
 Objects are arranged horizontally across the top;Objects are arranged horizontally across the top;
 Time is represented vertically so models are read topTime is represented vertically so models are read top
to bottom;to bottom;
 Interactions are represented by labelled arrows,Interactions are represented by labelled arrows,
Different styles of arrow represent different types ofDifferent styles of arrow represent different types of
interaction;interaction;
 A thin rectangle in an object lifeline represents theA thin rectangle in an object lifeline represents the
time when the object is the controlling object in thetime when the object is the controlling object in the
system.system.
12/07/15 47www.prsolutions08.blogspot.com
Data collection sequenceData collection sequence
:CommsController
request (repor t)
acknowledge ()
repor t ()
summarise ()
reply (repor t)
acknowledge ()
send (repor t)
:WeatherStation :WeatherData
12/07/15 48www.prsolutions08.blogspot.com
StatechartsStatecharts
 Show how objects respond to different service requestsShow how objects respond to different service requests
and the state transitions triggered by these requestsand the state transitions triggered by these requests
 If object state is Shutdown then it responds to a Startup()If object state is Shutdown then it responds to a Startup()
message;message;
 In the waiting state the object is waiting for further messages;In the waiting state the object is waiting for further messages;
 If reportWeather () then system moves to summarising state;If reportWeather () then system moves to summarising state;
 If calibrate () the system moves to a calibrating state;If calibrate () the system moves to a calibrating state;
 A collecting state is entered when a clock signal is received.A collecting state is entered when a clock signal is received.
12/07/15 49www.prsolutions08.blogspot.com
Weather station state diagramWeather station state diagram
transmission done
calibrate ()
test ()star tup ()
shutdown ()
calibration OK
test complete
weather summary
complete
clock collection
done
Operation
repor tWeather ()
Shutdown Waiting Testing
Transmitting
Collecting
Summarising
Calibrating
12/07/15 50www.prsolutions08.blogspot.com
Object interface specificationObject interface specification
 Object interfaces have to be specified so that theObject interfaces have to be specified so that the
objects and other components can be designed inobjects and other components can be designed in
parallel.parallel.
 Designers should avoid designing the interfaceDesigners should avoid designing the interface
representation but should hide this in the object itself.representation but should hide this in the object itself.
 Objects may have several interfaces which areObjects may have several interfaces which are
viewpoints on the methods provided.viewpoints on the methods provided.
 The UML uses class diagrams for interface specificationThe UML uses class diagrams for interface specification
but Java may also be used.but Java may also be used.
12/07/15 51www.prsolutions08.blogspot.com
Weather station interfaceWeather station interface
interface WeatherStation {
public void WeatherStation () ;
public void startup () ;
public void startup (Instrument i) ;
public void shutdown () ;
public void shutdown (Instrument i) ;
public void reportWeather ( ) ;
public void test () ;
public void test ( Instrument i ) ;
public void calibrate ( Instrument i) ;
public int getID () ;
} //WeatherStation
12/07/15 52www.prsolutions08.blogspot.com
Design evolutionDesign evolution
 Hiding information inside objects means thatHiding information inside objects means that
changes made to an object do not affect otherchanges made to an object do not affect other
objects in an unpredictable way.objects in an unpredictable way.
 Assume pollution monitoring facilities are to beAssume pollution monitoring facilities are to be
added to weather stations. These sample theadded to weather stations. These sample the
air and compute the amount of differentair and compute the amount of different
pollutants in the atmosphere.pollutants in the atmosphere.
 Pollution readings are transmitted with weatherPollution readings are transmitted with weather
data.data.
12/07/15 53www.prsolutions08.blogspot.com
Changes requiredChanges required
 Add an object class calledAdd an object class called Air qualityAir quality as part ofas part of
WeatherStationWeatherStation..
 Add an operationAdd an operation reportAirQualityreportAirQuality toto
WeatherStationWeatherStation. Modify the control software to. Modify the control software to
collect pollution readings.collect pollution readings.
 Add objects representing pollution monitoringAdd objects representing pollution monitoring
instruments.instruments.
12/07/15 54www.prsolutions08.blogspot.com
Pollution monitoringPollution monitoring
NOData
smokeData
benz eneData
collect ()
summarise ()
Air quality
identifier
repor tWeather ()
repor tAirQuality ()
calibrate (instruments)
test ()
star tup (instruments)
shutdown (instruments)
WeatherStation
Pollution monitoring instruments
NOmeter SmokeMeter
BenzeneMeter
12/07/15 55www.prsolutions08.blogspot.com
 OOD is an approach to design so that designOOD is an approach to design so that design
components have their own private state andcomponents have their own private state and
operations.operations.
 Objects should have constructor and inspectionObjects should have constructor and inspection
operations. They provide services to other objects.operations. They provide services to other objects.
 Objects may be implemented sequentially orObjects may be implemented sequentially or
concurrently.concurrently.
 The Unified Modeling Language provides differentThe Unified Modeling Language provides different
notations for defining different object models.notations for defining different object models.
Key pointsKey points
12/07/15 56www.prsolutions08.blogspot.com
Key pointsKey points
 A range of different models may be producedA range of different models may be produced
during an object-oriented design process. Theseduring an object-oriented design process. These
include static and dynamic system models.include static and dynamic system models.
 Object interfaces should be defined preciselyObject interfaces should be defined precisely
using e.g. a programming language like Java.using e.g. a programming language like Java.
 Object-oriented design potentially simplifiesObject-oriented design potentially simplifies
system evolution.system evolution.

Contenu connexe

Tendances

Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Coen De Roover
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsShanmuganathan C
 
Data Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersData Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersSatyam Jaiswal
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database conceptsTemesgenthanks
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patternspradeepkothiyal
 
COQUEL: A CONCEPTUAL QUERY LANGUAGE BASED ON THE ENTITYRELATIONSHIP MODEL
COQUEL: A CONCEPTUAL QUERY LANGUAGE BASED ON THE ENTITYRELATIONSHIP MODELCOQUEL: A CONCEPTUAL QUERY LANGUAGE BASED ON THE ENTITYRELATIONSHIP MODEL
COQUEL: A CONCEPTUAL QUERY LANGUAGE BASED ON THE ENTITYRELATIONSHIP MODELcsandit
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistencePrem Lamsal
 
Ekeko Technology Showdown at SoTeSoLa 2012
Ekeko Technology Showdown at SoTeSoLa 2012Ekeko Technology Showdown at SoTeSoLa 2012
Ekeko Technology Showdown at SoTeSoLa 2012Coen De Roover
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbmsmaryeem
 
Advanced Excel
Advanced Excel Advanced Excel
Advanced Excel eduCBA
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and designDabbal Singh Mahara
 
OMD chapter 2 Class modelling
 OMD  chapter 2 Class modelling OMD  chapter 2 Class modelling
OMD chapter 2 Class modellingjayashri kolekar
 
Module 5 oodb systems semantic db systems
Module 5 oodb systems  semantic db systemsModule 5 oodb systems  semantic db systems
Module 5 oodb systems semantic db systemsTaher Barodawala
 
Vb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.netVb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.netbantamlak dejene
 

Tendances (20)

03. oop concepts
03. oop concepts03. oop concepts
03. oop concepts
 
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
Multi-dimensional exploration of API usage - ICPC13 - 21-05-13
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
 
Introduction to odbms
Introduction to odbmsIntroduction to odbms
Introduction to odbms
 
Lecture 9
Lecture 9Lecture 9
Lecture 9
 
Data Structure Interview Questions & Answers
Data Structure Interview Questions & AnswersData Structure Interview Questions & Answers
Data Structure Interview Questions & Answers
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database concepts
 
Prophecy Of Design Patterns
Prophecy Of Design PatternsProphecy Of Design Patterns
Prophecy Of Design Patterns
 
COQUEL: A CONCEPTUAL QUERY LANGUAGE BASED ON THE ENTITYRELATIONSHIP MODEL
COQUEL: A CONCEPTUAL QUERY LANGUAGE BASED ON THE ENTITYRELATIONSHIP MODELCOQUEL: A CONCEPTUAL QUERY LANGUAGE BASED ON THE ENTITYRELATIONSHIP MODEL
COQUEL: A CONCEPTUAL QUERY LANGUAGE BASED ON THE ENTITYRELATIONSHIP MODEL
 
Encapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistenceEncapsulation of operations, methods & persistence
Encapsulation of operations, methods & persistence
 
Object oriented database
Object oriented databaseObject oriented database
Object oriented database
 
Ekeko Technology Showdown at SoTeSoLa 2012
Ekeko Technology Showdown at SoTeSoLa 2012Ekeko Technology Showdown at SoTeSoLa 2012
Ekeko Technology Showdown at SoTeSoLa 2012
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbms
 
Advanced Excel
Advanced Excel Advanced Excel
Advanced Excel
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and design
 
OMD chapter 2 Class modelling
 OMD  chapter 2 Class modelling OMD  chapter 2 Class modelling
OMD chapter 2 Class modelling
 
SEMINAR
SEMINARSEMINAR
SEMINAR
 
Module 5 oodb systems semantic db systems
Module 5 oodb systems  semantic db systemsModule 5 oodb systems  semantic db systems
Module 5 oodb systems semantic db systems
 
Classes2
Classes2Classes2
Classes2
 
Vb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.netVb ch 3-object-oriented_fundamentals_in_vb.net
Vb ch 3-object-oriented_fundamentals_in_vb.net
 

Similaire à Object oriented design-UNIT V

Software_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxSoftware_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxArifaMehreen1
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.pptTigistTilahun1
 
Object Oriented Database
Object Oriented DatabaseObject Oriented Database
Object Oriented DatabaseMegan Espinoza
 
Programming In C++
Programming In C++ Programming In C++
Programming In C++ shammi mehra
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesFellowBuddy.com
 
FORMALIZATION & DATA ABSTRACTION DURING USE CASE MODELING IN OBJECT ORIENTED ...
FORMALIZATION & DATA ABSTRACTION DURING USE CASE MODELING IN OBJECT ORIENTED ...FORMALIZATION & DATA ABSTRACTION DURING USE CASE MODELING IN OBJECT ORIENTED ...
FORMALIZATION & DATA ABSTRACTION DURING USE CASE MODELING IN OBJECT ORIENTED ...cscpconf
 
Formalization & data abstraction during use case modeling in object oriented ...
Formalization & data abstraction during use case modeling in object oriented ...Formalization & data abstraction during use case modeling in object oriented ...
Formalization & data abstraction during use case modeling in object oriented ...csandit
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering conceptsKomal Singh
 
Interview preparation for programming.pptx
Interview preparation for programming.pptxInterview preparation for programming.pptx
Interview preparation for programming.pptxBilalHussainShah5
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programmingPraveen Chowdary
 
Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdfSHIVAM691605
 

Similaire à Object oriented design-UNIT V (20)

Software_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxSoftware_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptx
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.ppt
 
Object Oriented Database
Object Oriented DatabaseObject Oriented Database
Object Oriented Database
 
Ch14
Ch14Ch14
Ch14
 
MCA NOTES.pdf
MCA NOTES.pdfMCA NOTES.pdf
MCA NOTES.pdf
 
Sdlc
SdlcSdlc
Sdlc
 
Sdlc
SdlcSdlc
Sdlc
 
Programming In C++
Programming In C++ Programming In C++
Programming In C++
 
Elaboration
ElaborationElaboration
Elaboration
 
Ch14
Ch14Ch14
Ch14
 
Intro Uml
Intro UmlIntro Uml
Intro Uml
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
 
FORMALIZATION & DATA ABSTRACTION DURING USE CASE MODELING IN OBJECT ORIENTED ...
FORMALIZATION & DATA ABSTRACTION DURING USE CASE MODELING IN OBJECT ORIENTED ...FORMALIZATION & DATA ABSTRACTION DURING USE CASE MODELING IN OBJECT ORIENTED ...
FORMALIZATION & DATA ABSTRACTION DURING USE CASE MODELING IN OBJECT ORIENTED ...
 
Formalization & data abstraction during use case modeling in object oriented ...
Formalization & data abstraction during use case modeling in object oriented ...Formalization & data abstraction during use case modeling in object oriented ...
Formalization & data abstraction during use case modeling in object oriented ...
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
 
Interview preparation for programming.pptx
Interview preparation for programming.pptxInterview preparation for programming.pptx
Interview preparation for programming.pptx
 
Ooad unit 1
Ooad unit 1Ooad unit 1
Ooad unit 1
 
PRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdfPRELIM-Lesson-2.pdf
PRELIM-Lesson-2.pdf
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 
Object-oriented modeling and design.pdf
Object-oriented modeling and  design.pdfObject-oriented modeling and  design.pdf
Object-oriented modeling and design.pdf
 

Plus de Azhar Shaik

Software engineering jwfiles 3
Software engineering jwfiles 3Software engineering jwfiles 3
Software engineering jwfiles 3Azhar Shaik
 
SOFTWARE ENGINEERING UNIT 6 Ch22
SOFTWARE ENGINEERING UNIT 6 Ch22SOFTWARE ENGINEERING UNIT 6 Ch22
SOFTWARE ENGINEERING UNIT 6 Ch22Azhar Shaik
 
SOFTWARE ENGINEERING UNIT 6 Ch14
SOFTWARE ENGINEERING UNIT 6 Ch14SOFTWARE ENGINEERING UNIT 6 Ch14
SOFTWARE ENGINEERING UNIT 6 Ch14Azhar Shaik
 
SOFTWARE ENGINEERING UNIT 6 Ch 13
SOFTWARE ENGINEERING UNIT 6 Ch 13SOFTWARE ENGINEERING UNIT 6 Ch 13
SOFTWARE ENGINEERING UNIT 6 Ch 13Azhar Shaik
 
Performing user interface design v
Performing user interface design vPerforming user interface design v
Performing user interface design vAzhar Shaik
 
S.e material2 DESIGN ENGINEERING
S.e material2 DESIGN ENGINEERINGS.e material2 DESIGN ENGINEERING
S.e material2 DESIGN ENGINEERINGAzhar Shaik
 
Unit 3 requirements engineering processes
Unit 3 requirements engineering processesUnit 3 requirements engineering processes
Unit 3 requirements engineering processesAzhar Shaik
 
Unit 3 system models
Unit 3 system modelsUnit 3 system models
Unit 3 system modelsAzhar Shaik
 
Unit 2 analysis and software requirements
Unit 2 analysis and software requirementsUnit 2 analysis and software requirements
Unit 2 analysis and software requirementsAzhar Shaik
 

Plus de Azhar Shaik (15)

Software engineering jwfiles 3
Software engineering jwfiles 3Software engineering jwfiles 3
Software engineering jwfiles 3
 
Unit 7 risk
Unit 7 riskUnit 7 risk
Unit 7 risk
 
Unit 6
Unit 6Unit 6
Unit 6
 
SOFTWARE ENGINEERING UNIT 6 Ch22
SOFTWARE ENGINEERING UNIT 6 Ch22SOFTWARE ENGINEERING UNIT 6 Ch22
SOFTWARE ENGINEERING UNIT 6 Ch22
 
SOFTWARE ENGINEERING UNIT 6 Ch14
SOFTWARE ENGINEERING UNIT 6 Ch14SOFTWARE ENGINEERING UNIT 6 Ch14
SOFTWARE ENGINEERING UNIT 6 Ch14
 
SOFTWARE ENGINEERING UNIT 6 Ch 13
SOFTWARE ENGINEERING UNIT 6 Ch 13SOFTWARE ENGINEERING UNIT 6 Ch 13
SOFTWARE ENGINEERING UNIT 6 Ch 13
 
Performing user interface design v
Performing user interface design vPerforming user interface design v
Performing user interface design v
 
S.e material2 DESIGN ENGINEERING
S.e material2 DESIGN ENGINEERINGS.e material2 DESIGN ENGINEERING
S.e material2 DESIGN ENGINEERING
 
Unit 4
Unit 4Unit 4
Unit 4
 
Unit 3 requirements engineering processes
Unit 3 requirements engineering processesUnit 3 requirements engineering processes
Unit 3 requirements engineering processes
 
Unit 3 system models
Unit 3 system modelsUnit 3 system models
Unit 3 system models
 
Unit 2
Unit 2Unit 2
Unit 2
 
Unit 2 analysis and software requirements
Unit 2 analysis and software requirementsUnit 2 analysis and software requirements
Unit 2 analysis and software requirements
 
S.e material
S.e materialS.e material
S.e material
 
Unit 1 se
Unit 1 seUnit 1 se
Unit 1 se
 

Dernier

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 

Dernier (20)

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 

Object oriented design-UNIT V

  • 2. 12/07/15 2 www.prsolutions08.blogspot.com ObjectivesObjectives  To explain how a software design may beTo explain how a software design may be represented as a set of interacting objects thatrepresented as a set of interacting objects that manage their own state and operationsmanage their own state and operations  To describe the activities in the object-orientedTo describe the activities in the object-oriented design processdesign process  To introduce various models that can be used toTo introduce various models that can be used to describe an object-oriented designdescribe an object-oriented design  To show how the UML may be used toTo show how the UML may be used to represent these modelsrepresent these models
  • 3. 12/07/15 3 www.prsolutions08.blogspot.com Topics coveredTopics covered  Objects and object classesObjects and object classes  An object-oriented design processAn object-oriented design process  Design evolutionDesign evolution
  • 4. 12/07/15 4 www.prsolutions08.blogspot.com Object-oriented developmentObject-oriented development  Object-oriented analysis, design and programming areObject-oriented analysis, design and programming are related but distinct.related but distinct.  OOA is concerned with developing an object model ofOOA is concerned with developing an object model of the application domain.the application domain.  OOD is concerned with developing an object-orientedOOD is concerned with developing an object-oriented system model to implement requirements.system model to implement requirements.  OOP is concerned with realising an OOD using an OOOOP is concerned with realising an OOD using an OO programming language such as Java or C++.programming language such as Java or C++.
  • 5. 12/07/15 5 www.prsolutions08.blogspot.com Characteristics of OODCharacteristics of OOD  Objects are abstractions of real-world or system entitiesObjects are abstractions of real-world or system entities and manage themselves.and manage themselves.  Objects are independent and encapsulate state andObjects are independent and encapsulate state and representation information.representation information.  System functionality is expressed in terms of objectSystem functionality is expressed in terms of object services.services.  Shared data areas are eliminated. ObjectsShared data areas are eliminated. Objects communicate by message passing.communicate by message passing.  Objects may be distributed and may executeObjects may be distributed and may execute sequentially or in parallel.sequentially or in parallel.
  • 6. 12/07/15 6www.prsolutions08.blogspot.com Interacting objectsInteracting objects state o3 o3:C3 state o4 o4: C4 state o1 o1: C1 state o6 o6: C1 state o5 o5:C5 state o2 o2: C3 ops1() ops3 () ops4 () ops3 () ops1 () ops5 ()
  • 7. 12/07/15 7www.prsolutions08.blogspot.com Advantages of OODAdvantages of OOD  Easier maintenance. Objects may beEasier maintenance. Objects may be understood as stand-alone entities.understood as stand-alone entities.  Objects are potentially reusable components.Objects are potentially reusable components.  For some systems, there may be an obviousFor some systems, there may be an obvious mapping from real world entities to systemmapping from real world entities to system objects.objects.
  • 8. 12/07/15 8www.prsolutions08.blogspot.com Objects and object classesObjects and object classes  Objects are entities in a software system whichObjects are entities in a software system which represent instances of real-world and systemrepresent instances of real-world and system entities.entities.  Object classes are templates for objects. TheyObject classes are templates for objects. They may be used to create objects.may be used to create objects.  Object classes may inherit attributes and servicesObject classes may inherit attributes and services from other object classes.from other object classes.
  • 9. 12/07/15 9www.prsolutions08.blogspot.com Objects and object classesObjects and object classes An object is an entity that has a state and a defined set of operations which operate on that state. The state is represented as a set of object attributes. The operations associated with the object provide services to other objects (clients) which request these services when some computation is required. Objects are created according to some object class definition. An object class definition serves as a template for objects. It includes declarations of all the attributes and services which should be associated with an object of that class.
  • 10. 12/07/15 10www.prsolutions08.blogspot.com The Unified Modeling LanguageThe Unified Modeling Language  Several different notations for describing object-Several different notations for describing object- oriented designs were proposed in the 1980s and 1990s.oriented designs were proposed in the 1980s and 1990s.  The Unified Modeling Language is an integration ofThe Unified Modeling Language is an integration of these notations.these notations.  It describes notations for a number of different modelsIt describes notations for a number of different models that may be produced during OO analysis and design.that may be produced during OO analysis and design.  It is now aIt is now a de factode facto standard for OO modelling.standard for OO modelling.
  • 11. 12/07/15 11S.Sreenivasa Rao Employee object class (UML)Employee object class (UML) Emplo yee name: string address: string dateOfBir th: Date employeeNo: integer socialSecurityNo: string depar tment: Dept manager: Employee salar y: integer status: {current, left, retired} taxCode: integer . .. join () leave () retire () changeDetails ()
  • 12. 12/07/15 12S.Sreenivasa Rao Object communicationObject communication  Conceptually, objects communicate byConceptually, objects communicate by message passing.message passing.  MessagesMessages  The name of the service requested by the calling object;The name of the service requested by the calling object;  Copies of the information required to execute the serviceCopies of the information required to execute the service and the name of a holder for the result of the service.and the name of a holder for the result of the service.  In practice, messages are often implementedIn practice, messages are often implemented by procedure callsby procedure calls  Name = procedure name;Name = procedure name;  Information = parameter list.Information = parameter list.
  • 13. 12/07/15 13www.prsolutions08.blogspot.com Message examplesMessage examples // Call a method associated with a buffer// Call a method associated with a buffer // object that returns the next value// object that returns the next value // in the buffer// in the buffer v = circularBuffer.Get () ;v = circularBuffer.Get () ; // Call the method associated with a// Call the method associated with a // thermostat object that sets the// thermostat object that sets the // temperature to be maintained// temperature to be maintained thermostat.setTemp (20) ;thermostat.setTemp (20) ;
  • 14. 12/07/15 14www.prsolutions08.blogspot.com Generalisation and inheritanceGeneralisation and inheritance  Objects are members of classes that defineObjects are members of classes that define attribute types and operations.attribute types and operations.  Classes may be arranged in a class hierarchyClasses may be arranged in a class hierarchy where one class (a super-class) is a generalisation of onewhere one class (a super-class) is a generalisation of one or more other classes (sub-classes).or more other classes (sub-classes).  A sub-class inherits the attributes andA sub-class inherits the attributes and operations from its super class and may addoperations from its super class and may add new methods or attributes of its own.new methods or attributes of its own.  Generalisation in the UML is implemented asGeneralisation in the UML is implemented as inheritance in OO programming languages.inheritance in OO programming languages.
  • 15. 12/07/15 15www.prsolutions08.blogspot.com A generalisation hierarchyA generalisation hierarchy Employee Programmer project progLanguages Mana ger Project Mana ger budgetsControlled dateAppointed projects Dept. Mana ger Strateg ic Mana ger dept responsibilities
  • 16. 12/07/15 16www.prsolutions08.blogspot.com Advantages of inheritanceAdvantages of inheritance  It is an abstraction mechanism which may beIt is an abstraction mechanism which may be used to classify entities.used to classify entities.  It is a reuse mechanism at both the design andIt is a reuse mechanism at both the design and the programming level.the programming level.  The inheritance graph is a source ofThe inheritance graph is a source of organisational knowledge about domains andorganisational knowledge about domains and systems.systems.
  • 17. 12/07/15 17www.prsolutions08.blogspot.com Problems with inheritanceProblems with inheritance  Object classes are not self-contained. theyObject classes are not self-contained. they cannot be understood without reference to theircannot be understood without reference to their super-classes.super-classes.  Designers have a tendency to reuse theDesigners have a tendency to reuse the inheritance graph created during analysis. Caninheritance graph created during analysis. Can lead to significant inefficiency.lead to significant inefficiency.  The inheritance graphs of analysis, design andThe inheritance graphs of analysis, design and implementation have different functions andimplementation have different functions and should be separately maintained.should be separately maintained.
  • 18. 12/07/15 18www.prsolutions08.blogspot.com UML associationsUML associations  Objects and object classes participate in relationshipsObjects and object classes participate in relationships with other objects and object classes.with other objects and object classes.  In the UML, a generalised relationship is indicated byIn the UML, a generalised relationship is indicated by an association.an association.  Associations may be annotated with information thatAssociations may be annotated with information that describes the association.describes the association.  Associations are general but may indicate that anAssociations are general but may indicate that an attribute of an object is an associated object or that aattribute of an object is an associated object or that a method relies on an associated object.method relies on an associated object.
  • 19. 12/07/15 19www.prsolutions08.blogspot.com An association modelAn association model Employee Depar tment Manager is-member-of is-managed-by manages
  • 20. 12/07/15 20www.prsolutions08.blogspot.com Concurrent objectsConcurrent objects  The nature of objects as self-contained entitiesThe nature of objects as self-contained entities make them suitable for concurrentmake them suitable for concurrent implementation.implementation.  The message-passing model of objectThe message-passing model of object communication can be implemented directly ifcommunication can be implemented directly if objects are running on separate processors in aobjects are running on separate processors in a distributed system.distributed system.
  • 21. 12/07/15 21www.prsolutions08.blogspot.com Servers and active objectsServers and active objects  Servers.Servers.  The object is implemented as a parallel process (server)The object is implemented as a parallel process (server) with entry points corresponding to object operations. If nowith entry points corresponding to object operations. If no calls are made to it, the object suspends itself and waits forcalls are made to it, the object suspends itself and waits for further requests for service.further requests for service.  Active objectsActive objects  Objects are implemented as parallel processes and theObjects are implemented as parallel processes and the internal object state may be changed by the object itself andinternal object state may be changed by the object itself and not simply by external calls.not simply by external calls.
  • 22. 12/07/15 22www.prsolutions08.blogspot.com Active transponder objectActive transponder object  Active objects may have their attributesActive objects may have their attributes modified by operations but may also updatemodified by operations but may also update them autonomously using internal operations.them autonomously using internal operations.  AA TransponderTransponder object broadcasts an aircraft’sobject broadcasts an aircraft’s position. The position may be updated using aposition. The position may be updated using a satellite positioning system. The objectsatellite positioning system. The object periodically update the position by triangulationperiodically update the position by triangulation from satellites.from satellites.
  • 23. 12/07/15 23www.prsolutions08.blogspot.com An active transponder objectAn active transponder object class Transponder extends Thread { Position currentPosition ; Coords c1, c2 ; Satellite sat1, sat2 ; Navigator theNavigator ; public Position givePosition () { return currentPosition ; } public void run () { while (true) { c1 = sat1.position () ; c2 = sat2.position () ; currentPosition = theNavigator.compute (c1, c2) ; } } } //Transponder
  • 24. 12/07/15 24www.prsolutions08.blogspot.com Java threadsJava threads  Threads in Java are a simple construct forThreads in Java are a simple construct for implementing concurrent objects.implementing concurrent objects.  Threads must include a method called run() andThreads must include a method called run() and this is started up by the Java run-time system.this is started up by the Java run-time system.  Active objects typically include an infinite loopActive objects typically include an infinite loop so that they are always carrying out theso that they are always carrying out the computation.computation.
  • 25. 12/07/15 25www.prsolutions08.blogspot.com An object-oriented designAn object-oriented design processprocess  Structured design processes involve developing aStructured design processes involve developing a number of different system models.number of different system models.  They require a lot of effort for development andThey require a lot of effort for development and maintenance of these models and, for smallmaintenance of these models and, for small systems, this may not be cost-effective.systems, this may not be cost-effective.  However, for large systems developed byHowever, for large systems developed by different groups design models are an essentialdifferent groups design models are an essential communication mechanism.communication mechanism.
  • 26. 12/07/15 26www.prsolutions08.blogspot.com Process stagesProcess stages  Highlights key activities without being tied toHighlights key activities without being tied to any proprietary process such as the RUP.any proprietary process such as the RUP.  Define the context and modes of use of the system;Define the context and modes of use of the system;  Design the system architecture;Design the system architecture;  Identify the principal system objects;Identify the principal system objects;  Develop design models;Develop design models;  Specify object interfaces.Specify object interfaces.
  • 27. 12/07/15 27www.prsolutions08.blogspot.com Weather system descriptionWeather system description A weather mapping system is required to generate weather maps on a regular basis using data collected from remote, unattended weather stations and other data sources such as weather observers, balloons and satellites. Weather stations transmit their data to the area computer in response to a request from that machine. The area computer system 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.
  • 28. 12/07/15 28www.prsolutions08.blogspot.com System context and models of useSystem context and models of use  Develop an understanding of the relationships betweenDevelop an understanding of the relationships between the software being designed and its externalthe software being designed and its external environmentenvironment  System contextSystem context  A static model that describes other systems in theA static model that describes other systems in the environment. Use a subsystem model to show other systems.environment. Use a subsystem model to show other systems. Following slide shows the systems around the weather stationFollowing slide shows the systems around the weather station system.system.  Model of system useModel of system use  A dynamic model that describes how the system interactsA dynamic model that describes how the system interacts with its environment. Use use-cases to show interactionswith its environment. Use use-cases to show interactions
  • 29. 12/07/15 29www.prsolutions08.blogspot.com Layered architectureLayered architecture « subsystem» Data collection « subsystem» Data processing « subsystem» Data archiving « subsystem» Data display Data collection layer where objects are concerned with acquiring data from remote sources Data processing layer where objects are concerned with checking and integ rating the collected data Data archiving layer where objects are concerned with storing the data for future processing Data display layer where objects are concerned with preparing and presenting the data in a human- readable form
  • 30. 12/07/15 30www.prsolutions08.blogspot.com Subsystems in the weather mapping systemSubsystems in the weather mapping system Data storage User inter face « subsystem» Data collection « subsystem» Data processing « subsystem» Data archiving « subsystem» Data display Weather station Satellite Comms Balloon Observer Map store Data store Data storage Map User inter face Map display Map printer Data checking Data integ ration
  • 31. 12/07/15 31www.prsolutions08.blogspot.com Use-case modelsUse-case models  Use-case models are used to represent eachUse-case models are used to represent each interaction with the system.interaction with the system.  A use-case model shows the system features asA use-case model shows the system features as ellipses and the interacting entity as a stickellipses and the interacting entity as a stick figure.figure.
  • 32. 12/07/15 32www.prsolutions08.blogspot.com Use-cases for the weather stationUse-cases for the weather station Star tup Shutdown Repor t Calibrate Test
  • 33. 12/07/15 33www.prsolutions08.blogspot.com Use-case descriptionUse-case description 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.
  • 34. 12/07/15 34www.prsolutions08.blogspot.com Architectural designArchitectural design  Once interactions between the system and itsOnce interactions between the system and its environment have been understood, you use thisenvironment have been understood, you use this information for designing the system architecture.information for designing the system architecture.  A layered architecture as discussed in Chapter 11 isA layered architecture as discussed in Chapter 11 is appropriate for the weather stationappropriate for the weather station  Interface layer for handling communications;Interface layer for handling communications;  Data collection layer for managing instruments;Data collection layer for managing instruments;  Instruments layer for collecting data.Instruments layer for collecting data.  There should normally be no more than 7 entities in anThere should normally be no more than 7 entities in an architectural model.architectural model.
  • 35. 12/07/15 35www.prsolutions08.blogspot.com Weather station architectureWeather station architecture Weather station Manages all external communications Collects and summarises weather data Package of instruments for raw data collections « subsystem» Data collection « subsystem» Instruments « subsystem» Interface
  • 36. 12/07/15 36www.prsolutions08.blogspot.com Object identificationObject identification  Identifying objects (or object classes) is the mostIdentifying objects (or object classes) is the most difficult part of object oriented design.difficult part of object oriented design.  There is no 'magic formula' for objectThere is no 'magic formula' for object identification. It relies on the skill, experienceidentification. It relies on the skill, experience and domain knowledge of system designers.and domain knowledge of system designers.  Object identification is an iterative process. YouObject identification is an iterative process. You are unlikely to get it right first time.are unlikely to get it right first time.
  • 37. 12/07/15 37www.prsolutions08.blogspot.com Approaches to identificationApproaches to identification  Use a grammatical approach based on a naturalUse a grammatical approach based on a natural language description of the system (used in Hoodlanguage description of the system (used in Hood OOD method).OOD method).  Base the identification on tangible things in theBase the identification on tangible things in the application domain.application domain.  Use a behavioural approach and identify objects basedUse a behavioural approach and identify objects based on what participates in what behaviour.on what participates in what behaviour.  Use a scenario-based analysis. The objects, attributesUse a scenario-based analysis. The objects, attributes and methods in each scenario are identified.and methods in each scenario are identified.
  • 38. 12/07/15 38www.prsolutions08.blogspot.com Weather station descriptionWeather station description 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 periodically. When a command is issued to transmit the weather data, the weather station processes and summarises the collected data. The summarised data is transmitted to the mapping computer when a request is received.
  • 39. 12/07/15 39www.prsolutions08.blogspot.com Weather station object classesWeather station object classes  Ground thermometer, Anemometer, BarometerGround thermometer, Anemometer, Barometer  Application domain objects that are ‘hardware’ objects relatedApplication domain objects that are ‘hardware’ objects related to the instruments in the system.to the instruments in the system.  Weather stationWeather station  The basic interface of the weather station to its environment.The basic interface of the weather station to its environment. It therefore reflects the interactions identified in the use-caseIt therefore reflects the interactions identified in the use-case model.model.  Weather dataWeather data  Encapsulates the summarised data from the instruments.Encapsulates the summarised data from the instruments.
  • 40. 12/07/15 40www.prsolutions08.blogspot.com Weather station object classesWeather station object classes identifier repor tWeather () calibrate (instruments) test () star tup (instruments) shutdown (instruments) WeatherStation test () calibrate () Ground thermomet er temper ature Anemomet er windSpeed windDirection test () Baromet er pressure height test () calibrate () WeatherData airTemper atures groundT emper atures windSpeeds windDirections pressures rainfall collect () summarise ()
  • 41. 12/07/15 41www.prsolutions08.blogspot.com Further objects and object refinementFurther objects and object refinement  Use domain knowledge to identify more objects andUse domain knowledge to identify more objects and operationsoperations  Weather stations should have a unique identifier;Weather stations should have a unique identifier;  Weather stations are remotely situated so instrument failuresWeather stations are remotely situated so instrument failures have to be reported automatically. Therefore attributes andhave to be reported automatically. Therefore attributes and operations for self-checking are required.operations for self-checking are required.  Active or passive objectsActive or passive objects  In this case, objects are passive and collect data on requestIn this case, objects are passive and collect data on request rather than autonomously. This introduces flexibility at therather than autonomously. This introduces flexibility at the expense of controller processing time.expense of controller processing time.
  • 42. 12/07/15 42www.prsolutions08.blogspot.com Design modelsDesign models  Design models show the objects and objectDesign models show the objects and object classes and relationships between these entities.classes and relationships between these entities.  Static models describe the static structure of theStatic models describe the static structure of the system in terms of object classes andsystem in terms of object classes and relationships.relationships.  Dynamic models describe the dynamicDynamic models describe the dynamic interactions between objects.interactions between objects.
  • 43. 12/07/15 43S.Sreenivasa Rao Examples of design modelsExamples of design models  Sub-system models that show logical groupings ofSub-system models that show logical groupings of objects into coherent subsystems.objects into coherent subsystems.  Sequence models that show the sequence of objectSequence models that show the sequence of object interactions.interactions.  State machine models that show how individual objectsState machine models that show how individual objects change their state in response to events.change their state in response to events.  Other models include use-case models, aggregationOther models include use-case models, aggregation models, generalisation models, etc.models, generalisation models, etc.
  • 44. 12/07/15 44S.Sreenivasa Rao Subsystem modelsSubsystem models  Shows how the design is organised into logicallyShows how the design is organised into logically related groups of objects.related groups of objects.  In the UML, these are shown using packages -In the UML, these are shown using packages - an encapsulation construct. This is a logicalan encapsulation construct. This is a logical model. The actual organisation of objects in themodel. The actual organisation of objects in the system may be different.system may be different.
  • 45. 12/07/15 45S.Sreenivasa Rao Weather station subsystemsWeather station subsystems « subsystem» Inter face « subsystem» Data collection CommsController WeatherStation WeatherData Instrument Status « subsystem» Instruments Air thermometer Ground thermometer RainGauge Barometer Anemometer WindVane
  • 46. 12/07/15 46S.Sreenivasa Rao Sequence modelsSequence models  Sequence models show the sequence of objectSequence models show the sequence of object interactions that take placeinteractions that take place  Objects are arranged horizontally across the top;Objects are arranged horizontally across the top;  Time is represented vertically so models are read topTime is represented vertically so models are read top to bottom;to bottom;  Interactions are represented by labelled arrows,Interactions are represented by labelled arrows, Different styles of arrow represent different types ofDifferent styles of arrow represent different types of interaction;interaction;  A thin rectangle in an object lifeline represents theA thin rectangle in an object lifeline represents the time when the object is the controlling object in thetime when the object is the controlling object in the system.system.
  • 47. 12/07/15 47www.prsolutions08.blogspot.com Data collection sequenceData collection sequence :CommsController request (repor t) acknowledge () repor t () summarise () reply (repor t) acknowledge () send (repor t) :WeatherStation :WeatherData
  • 48. 12/07/15 48www.prsolutions08.blogspot.com StatechartsStatecharts  Show how objects respond to different service requestsShow how objects respond to different service requests and the state transitions triggered by these requestsand the state transitions triggered by these requests  If object state is Shutdown then it responds to a Startup()If object state is Shutdown then it responds to a Startup() message;message;  In the waiting state the object is waiting for further messages;In the waiting state the object is waiting for further messages;  If reportWeather () then system moves to summarising state;If reportWeather () then system moves to summarising state;  If calibrate () the system moves to a calibrating state;If calibrate () the system moves to a calibrating state;  A collecting state is entered when a clock signal is received.A collecting state is entered when a clock signal is received.
  • 49. 12/07/15 49www.prsolutions08.blogspot.com Weather station state diagramWeather station state diagram transmission done calibrate () test ()star tup () shutdown () calibration OK test complete weather summary complete clock collection done Operation repor tWeather () Shutdown Waiting Testing Transmitting Collecting Summarising Calibrating
  • 50. 12/07/15 50www.prsolutions08.blogspot.com Object interface specificationObject interface specification  Object interfaces have to be specified so that theObject interfaces have to be specified so that the objects and other components can be designed inobjects and other components can be designed in parallel.parallel.  Designers should avoid designing the interfaceDesigners should avoid designing the interface representation but should hide this in the object itself.representation but should hide this in the object itself.  Objects may have several interfaces which areObjects may have several interfaces which are viewpoints on the methods provided.viewpoints on the methods provided.  The UML uses class diagrams for interface specificationThe UML uses class diagrams for interface specification but Java may also be used.but Java may also be used.
  • 51. 12/07/15 51www.prsolutions08.blogspot.com Weather station interfaceWeather station interface interface WeatherStation { public void WeatherStation () ; public void startup () ; public void startup (Instrument i) ; public void shutdown () ; public void shutdown (Instrument i) ; public void reportWeather ( ) ; public void test () ; public void test ( Instrument i ) ; public void calibrate ( Instrument i) ; public int getID () ; } //WeatherStation
  • 52. 12/07/15 52www.prsolutions08.blogspot.com Design evolutionDesign evolution  Hiding information inside objects means thatHiding information inside objects means that changes made to an object do not affect otherchanges made to an object do not affect other objects in an unpredictable way.objects in an unpredictable way.  Assume pollution monitoring facilities are to beAssume pollution monitoring facilities are to be added to weather stations. These sample theadded to weather stations. These sample the air and compute the amount of differentair and compute the amount of different pollutants in the atmosphere.pollutants in the atmosphere.  Pollution readings are transmitted with weatherPollution readings are transmitted with weather data.data.
  • 53. 12/07/15 53www.prsolutions08.blogspot.com Changes requiredChanges required  Add an object class calledAdd an object class called Air qualityAir quality as part ofas part of WeatherStationWeatherStation..  Add an operationAdd an operation reportAirQualityreportAirQuality toto WeatherStationWeatherStation. Modify the control software to. Modify the control software to collect pollution readings.collect pollution readings.  Add objects representing pollution monitoringAdd objects representing pollution monitoring instruments.instruments.
  • 54. 12/07/15 54www.prsolutions08.blogspot.com Pollution monitoringPollution monitoring NOData smokeData benz eneData collect () summarise () Air quality identifier repor tWeather () repor tAirQuality () calibrate (instruments) test () star tup (instruments) shutdown (instruments) WeatherStation Pollution monitoring instruments NOmeter SmokeMeter BenzeneMeter
  • 55. 12/07/15 55www.prsolutions08.blogspot.com  OOD is an approach to design so that designOOD is an approach to design so that design components have their own private state andcomponents have their own private state and operations.operations.  Objects should have constructor and inspectionObjects should have constructor and inspection operations. They provide services to other objects.operations. They provide services to other objects.  Objects may be implemented sequentially orObjects may be implemented sequentially or concurrently.concurrently.  The Unified Modeling Language provides differentThe Unified Modeling Language provides different notations for defining different object models.notations for defining different object models. Key pointsKey points
  • 56. 12/07/15 56www.prsolutions08.blogspot.com Key pointsKey points  A range of different models may be producedA range of different models may be produced during an object-oriented design process. Theseduring an object-oriented design process. These include static and dynamic system models.include static and dynamic system models.  Object interfaces should be defined preciselyObject interfaces should be defined precisely using e.g. a programming language like Java.using e.g. a programming language like Java.  Object-oriented design potentially simplifiesObject-oriented design potentially simplifies system evolution.system evolution.