SlideShare une entreprise Scribd logo
1  sur  28
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 1
Object-oriented Design
Designing systems using self-
contained objects and object
classes
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 2
Objectives
To explain how a software design may be
represented as a set of interacting objects
To illustrate, with a simple example, the object-
oriented design process
To introduce various models which describe an
object-oriented design
To explain how objects may be represented as
concurrent processes
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 3
Topics covered
Objects, object classes and inheritance
Object identification
An object-oriented design example
Concurrent objects
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 4
Characteristics of OOD
Objects are abstractions of real-world or system
entities and manage themselves
Objects are independent and encapsulate state and
representation information.
System functionality is expressed in terms of
object services
Shared data areas are eliminated. Objects
communicate by message passing
Objects may be distributed and may execute
sequentially or in parallel
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 5
OOD structure
state 3
O3
state 4
O4
state 1
O1
state 6
O6
state 5
O5
state 2
O2
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 6
Advantages of OOD
Easier maintenance. Objects may be
understood as stand-alone entities
Objects are appropriate reusable components
For some systems, there may be an obvious
mapping from real world entities to system
objects
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 7
Object-oriented development
Object-oriented analysis, design and
programming are related but distinct
OOA is concerned with developing an object
model of the application domain
OOD is concerned with developing an object-
oriented system model to implement
requirements
OOP is concerned with realising an OOD using
an OO programming language such as C++
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 8
Object-oriented design methods
Some methods which were originally based on
functions (such as the Yourdon method) have
been adapted to object-oriented design. Other
methods such as the Booch method have been
developed specifically for OOD
HOOD is an object-oriented design method
developed to support Ada programming.
JSD has an object-oriented flavour but does not
conceal entity state information.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 9
OO Design method commonality
The identification of objects, their attributes and
services
The organisation of objects into an aggregation
hierarchy
The construction of dynamic object-use
descriptions which show how services are used
The specification of object interfaces
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 10
Objects, classes and inheritance
Objects are entities in a software system which
represent instances of real-world and system
entities
Object classes are templates for objects. They
may be used to create objects
Object classes may inherit attributes and services
from other object classes
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 11
Objects
An object is an entity which 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.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 12
Object communication
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.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 13
A mail message object class
Replace with portrait slide
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 14
Inheritance
Objects are members of classes which define
attribute types and operations
Classes may be arranged in a class hierarchy
where one class is derived from an existing
class (super-class)
A sub-class inherits the attributes and
operations from its super class and may add
new methods or attributes of its own
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 15
A class or type hierarchy
Replace with portrait slide
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 16
Multiple inheritance
Replace with portrait slide
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 17
Advantages of inheritance
It is an abstraction mechanism which may be
used to classify entities
It is a reuse mechanism at both the design and the
programming level
The inheritance graph is a source of
organisational knowledge about domains and
systems
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 18
Inheritance and OOD
There are differing views as to whether
inheritance is fundamental to OOD.
• View 1. Identifying the inheritance hierarchy or network is a
fundamental part of object-oriented design. Obviously this can
only be implemented using an OOPL.
• View 2. Inheritance is a useful implementation concept which
allows reuse of attribute and operation definitions. Identifying
an inheritance hierarchy at the design stage places unnecessary
restrictions on the implementation.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 19
Object identification
Identifying objects is the most difficult part of
object oriented design.
There is no 'magic formula' for object
identification. It relies on the skill, experience
and domain knowledge of system designers.
Object identification is an iterative process. You
are unlikely to get it right first time
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 20
Approaches to identification
Use a grammatical approach based on a natural
language description of the system (used in Hood
method)
Base the identification on tangible things in the
application domain
Use a behavioural approach and identify objects
based on what participates in what behaviour
Use a scenario-based analysis. Used in the
ObjectOry method
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 21
Objects and operations
Nouns in the description give pointers to objects
in the system
Verbs give pointers to operations associated with
objects
Approach assumes that the designer has a
common sense knowledge of the application
domain as not all objects and services are likely
to be mentioned in the description
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 22
An office information system
The Office Information Retrieval System (OIRS) is
an automatic file clerk which can file documents
under some name in one or more indexes, retrieve
documents, display and maintain document
indexes, archive documents and destroy
documents. The system is activated by a request
from the user and always returns a message to the
user indicating the success or failure of the request.
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 23
Preliminary object identification
File
Retrieve
A rchive
Destroy
Docume nt
Name
Display
Delete entry
A dd entry
I ndex
Name
Get command
Put message
U se r R e trieva l
sy ste m
User command
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 24
Object interface design
Concerned with specifying the detail of the object
interfaces. This means defining attribute types
and the signatures and semantics of object
operations
Representation information should be avoided
Precise specification is essential so a
programming language description should be
used
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 25
Concurrent objects
The nature of objects as self-contained entities
make them suitable for concurrent
implementation
The message-passing model of object
communication can be implemented directly if
objects are running on separate processors in a
distributed system
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 26
Active and passive objects
Passive objects.
• The object is implemented as a parallel process (server)
with entry points corresponding to object operations. If no
calls are made to it, the object suspends itself
Active objects
• Objects are implemented as parallel processes and the
internal object state may be changed by the object itself and
not simply by external calls
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 27
OOD is design with information hiding.
Representations may be changed without
extensive system modifications
An object has a private state with associated
constructor and access operations. Objects
provide services (operations) to other objects.
Object identification is a difficult process.
Identifying nouns and verbs in a natural
language description can be a useful starting
point for object identification.
Key points
©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 28
Key points
Object interfaces must be precisely defined. A
programming language such as Ada or C++ may
be used for this
Useful documentation of an OOD include object
hierarchy charts and object interaction
diagrams
Objects may be implemented as either
sequential or concurrent entities. Concurrent
objects may be active or passive

Contenu connexe

Tendances

Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
ramyaaswin
 
Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12
koolkampus
 
Dynamic and Static Modeling
Dynamic and Static ModelingDynamic and Static Modeling
Dynamic and Static Modeling
Saurabh Kumar
 
Slide 4 Interaction Diagram
Slide 4 Interaction DiagramSlide 4 Interaction Diagram
Slide 4 Interaction Diagram
Niloy Rocker
 

Tendances (20)

Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
 
Unit 3(advanced state modeling & interaction meodelling)
Unit  3(advanced state modeling & interaction meodelling)Unit  3(advanced state modeling & interaction meodelling)
Unit 3(advanced state modeling & interaction meodelling)
 
Ooad
OoadOoad
Ooad
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
 
CS8592-OOAD Lecture Notes Unit-1
CS8592-OOAD Lecture Notes Unit-1CS8592-OOAD Lecture Notes Unit-1
CS8592-OOAD Lecture Notes Unit-1
 
object oriented methodologies
object oriented methodologiesobject oriented methodologies
object oriented methodologies
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Rad model
Rad modelRad model
Rad model
 
Sequence diagram- UML diagram
Sequence diagram- UML diagramSequence diagram- UML diagram
Sequence diagram- UML diagram
 
Use case Diagram
Use case Diagram Use case Diagram
Use case Diagram
 
Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
 
Activity diagrams
Activity diagramsActivity diagrams
Activity diagrams
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
 
Dynamic modeling
Dynamic modelingDynamic modeling
Dynamic modeling
 
Uml Common Mechanism
Uml Common MechanismUml Common Mechanism
Uml Common Mechanism
 
Uml
UmlUml
Uml
 
Dynamic and Static Modeling
Dynamic and Static ModelingDynamic and Static Modeling
Dynamic and Static Modeling
 
Slide 4 Interaction Diagram
Slide 4 Interaction DiagramSlide 4 Interaction Diagram
Slide 4 Interaction Diagram
 

Similaire à Object Oriented Design Concept

Ch7-Software Engineering 9
Ch7-Software Engineering 9Ch7-Software Engineering 9
Ch7-Software Engineering 9
Ian Sommerville
 
Software Engineering - Ch8
Software Engineering - Ch8Software Engineering - Ch8
Software Engineering - Ch8
Siddharth Ayer
 

Similaire à Object Oriented Design Concept (20)

Ch14
Ch14Ch14
Ch14
 
ch12 (1).ppt
ch12 (1).pptch12 (1).ppt
ch12 (1).ppt
 
Object oriented design-UNIT V
Object oriented design-UNIT VObject oriented design-UNIT V
Object oriented design-UNIT V
 
Testing method pptx
Testing method pptxTesting method pptx
Testing method pptx
 
07 - Design and Implementation.pptx
07 - Design and Implementation.pptx07 - Design and Implementation.pptx
07 - Design and Implementation.pptx
 
UML_Training.ppt
UML_Training.pptUML_Training.ppt
UML_Training.ppt
 
C#.net, C Sharp.Net Online Training Course Content
C#.net, C Sharp.Net Online Training Course ContentC#.net, C Sharp.Net Online Training Course Content
C#.net, C Sharp.Net Online Training Course Content
 
Ch7-Software Engineering 9
Ch7-Software Engineering 9Ch7-Software Engineering 9
Ch7-Software Engineering 9
 
Chapter 1- Introduction.ppt
Chapter 1- Introduction.pptChapter 1- Introduction.ppt
Chapter 1- Introduction.ppt
 
ch14.ppt
ch14.pptch14.ppt
ch14.ppt
 
Function Oriented Design
Function Oriented DesignFunction Oriented Design
Function Oriented Design
 
Software Engineering - Ch8
Software Engineering - Ch8Software Engineering - Ch8
Software Engineering - Ch8
 
System Modelling
System ModellingSystem Modelling
System Modelling
 
Se chapter 1,2,3 2 mark qa
Se chapter 1,2,3   2 mark  qaSe chapter 1,2,3   2 mark  qa
Se chapter 1,2,3 2 mark qa
 
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
 
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
Software_Engineering_7th_Edition_Chapters_10_11_Detailed_Software_Design_Prin...
 
CS8592 Object Oriented Analysis & Design - UNIT I
CS8592 Object Oriented Analysis & Design - UNIT ICS8592 Object Oriented Analysis & Design - UNIT I
CS8592 Object Oriented Analysis & Design - UNIT I
 
Software Processes
Software ProcessesSoftware Processes
Software Processes
 
OOAD-FULL-UNITS (full unit) SEE6A
OOAD-FULL-UNITS (full unit) SEE6AOOAD-FULL-UNITS (full unit) SEE6A
OOAD-FULL-UNITS (full unit) SEE6A
 
System Design
System DesignSystem Design
System Design
 

Dernier

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

Object Oriented Design Concept

  • 1. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 1 Object-oriented Design Designing systems using self- contained objects and object classes
  • 2. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 2 Objectives To explain how a software design may be represented as a set of interacting objects To illustrate, with a simple example, the object- oriented design process To introduce various models which describe an object-oriented design To explain how objects may be represented as concurrent processes
  • 3. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 3 Topics covered Objects, object classes and inheritance Object identification An object-oriented design example Concurrent objects
  • 4. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 4 Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent and encapsulate state and representation information. System functionality is expressed in terms of object services Shared data areas are eliminated. Objects communicate by message passing Objects may be distributed and may execute sequentially or in parallel
  • 5. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 5 OOD structure state 3 O3 state 4 O4 state 1 O1 state 6 O6 state 5 O5 state 2 O2
  • 6. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 6 Advantages of OOD Easier maintenance. Objects may be understood as stand-alone entities Objects are appropriate reusable components For some systems, there may be an obvious mapping from real world entities to system objects
  • 7. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 7 Object-oriented development Object-oriented analysis, design and programming are related but distinct OOA is concerned with developing an object model of the application domain OOD is concerned with developing an object- oriented system model to implement requirements OOP is concerned with realising an OOD using an OO programming language such as C++
  • 8. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 8 Object-oriented design methods Some methods which were originally based on functions (such as the Yourdon method) have been adapted to object-oriented design. Other methods such as the Booch method have been developed specifically for OOD HOOD is an object-oriented design method developed to support Ada programming. JSD has an object-oriented flavour but does not conceal entity state information.
  • 9. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 9 OO Design method commonality The identification of objects, their attributes and services The organisation of objects into an aggregation hierarchy The construction of dynamic object-use descriptions which show how services are used The specification of object interfaces
  • 10. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 10 Objects, classes and inheritance Objects are entities in a software system which represent instances of real-world and system entities Object classes are templates for objects. They may be used to create objects Object classes may inherit attributes and services from other object classes
  • 11. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 11 Objects An object is an entity which 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. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 12 Object communication 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.
  • 13. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 13 A mail message object class Replace with portrait slide
  • 14. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 14 Inheritance Objects are members of classes which define attribute types and operations Classes may be arranged in a class hierarchy where one class is derived from an existing class (super-class) A sub-class inherits the attributes and operations from its super class and may add new methods or attributes of its own
  • 15. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 15 A class or type hierarchy Replace with portrait slide
  • 16. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 16 Multiple inheritance Replace with portrait slide
  • 17. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 17 Advantages of inheritance It is an abstraction mechanism which may be used to classify entities It is a reuse mechanism at both the design and the programming level The inheritance graph is a source of organisational knowledge about domains and systems
  • 18. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 18 Inheritance and OOD There are differing views as to whether inheritance is fundamental to OOD. • View 1. Identifying the inheritance hierarchy or network is a fundamental part of object-oriented design. Obviously this can only be implemented using an OOPL. • View 2. Inheritance is a useful implementation concept which allows reuse of attribute and operation definitions. Identifying an inheritance hierarchy at the design stage places unnecessary restrictions on the implementation.
  • 19. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 19 Object identification Identifying objects is the most difficult part of object oriented design. There is no 'magic formula' for object identification. It relies on the skill, experience and domain knowledge of system designers. Object identification is an iterative process. You are unlikely to get it right first time
  • 20. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 20 Approaches to identification Use a grammatical approach based on a natural language description of the system (used in Hood method) Base the identification on tangible things in the application domain Use a behavioural approach and identify objects based on what participates in what behaviour Use a scenario-based analysis. Used in the ObjectOry method
  • 21. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 21 Objects and operations Nouns in the description give pointers to objects in the system Verbs give pointers to operations associated with objects Approach assumes that the designer has a common sense knowledge of the application domain as not all objects and services are likely to be mentioned in the description
  • 22. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 22 An office information system The Office Information Retrieval System (OIRS) is an automatic file clerk which can file documents under some name in one or more indexes, retrieve documents, display and maintain document indexes, archive documents and destroy documents. The system is activated by a request from the user and always returns a message to the user indicating the success or failure of the request.
  • 23. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 23 Preliminary object identification File Retrieve A rchive Destroy Docume nt Name Display Delete entry A dd entry I ndex Name Get command Put message U se r R e trieva l sy ste m User command
  • 24. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 24 Object interface design Concerned with specifying the detail of the object interfaces. This means defining attribute types and the signatures and semantics of object operations Representation information should be avoided Precise specification is essential so a programming language description should be used
  • 25. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 25 Concurrent objects The nature of objects as self-contained entities make them suitable for concurrent implementation The message-passing model of object communication can be implemented directly if objects are running on separate processors in a distributed system
  • 26. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 26 Active and passive objects Passive objects. • The object is implemented as a parallel process (server) with entry points corresponding to object operations. If no calls are made to it, the object suspends itself Active objects • Objects are implemented as parallel processes and the internal object state may be changed by the object itself and not simply by external calls
  • 27. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 27 OOD is design with information hiding. Representations may be changed without extensive system modifications An object has a private state with associated constructor and access operations. Objects provide services (operations) to other objects. Object identification is a difficult process. Identifying nouns and verbs in a natural language description can be a useful starting point for object identification. Key points
  • 28. ©Ian Sommerville 1995 Software Engineering, 5th edition. Chapter 14 Slide 28 Key points Object interfaces must be precisely defined. A programming language such as Ada or C++ may be used for this Useful documentation of an OOD include object hierarchy charts and object interaction diagrams Objects may be implemented as either sequential or concurrent entities. Concurrent objects may be active or passive