SlideShare a Scribd company logo
OBJECT ORIENTED
PROGRAMING
Benefits of the Object Model
• First, the use of the object model helps us to exploit the expressive
power of object-based and object-oriented programming languages,
using the class and object as basic building blocks.
• Second, the use of the object model encourages the reuse not only of
software but of entire designs, leading to the creation of reusable
application frameworks
• Third, the use of the object model produces systems that are built on
stable intermediate forms, which are more resilient to change.
What Is and What Isn’t an Object
• an object is any of the following:
• A tangible and/or visible thing
• Something that may be comprehended intellectually
• Something toward which thought or action is directed
• Jacobson et al. define control objects as “the ones that unite
courses of events and thus will carry on communication with
other objects” [62].
• This leads us to the more refined definition of Smith and Tockey,
who suggest that “an object represents an individual,
identifiable item, unit, or entity, either real or abstract, with a
well-defined role in the problem domain”
• Some objects may have crisp conceptual boundaries yet represent
intangible events or processes.
• For example, a chemical process in a manufacturing plant may be
treated as an object because it has a crisp conceptual boundary,
interacts with certain other objects through a well-ordered collection
of operations that unfolds over time, and exhibits a well-defined
behavior.
An object is an entity that has state, behaviour, and identity. The
structure and behaviour of similar objects are defined in their common
class. The terms instance and object are interchangeable.
State
The state of an object encompasses all of the (usually static) properties of
the object plus the current (usually dynamic) values of each of these
properties.
Employee Class with Attributes
Employee Objects Tom and Kaitlyn
Behaviour
• Behaviour is how an object acts and reacts, in terms of its state changes and
message passing.
• In other words, the behaviour of an object represents its outwardly visible
activity.
• An operation is some action that one object performs on another in order to
elicit a reaction.
• For example, a client might invoke the operations append and pop to grow
and shrink a queue object, respectively.
• A client might also invoke the operation length, which returns a value
denoting the size of the queue object but does not alter the state of the
queue itself.
• Message passing is one part of the equation that defines the behaviour of an
object; our definition for behaviour also notes that the state of an object
affects its behaviour as well.
Operations
• An operation denotes a service that a class offers to its clients.
In practice, we have found that a client typically performs five
kinds of operations on an object.
• The three most common kinds of operations are the
following:
• Modifier/ Mutators : an operation that alters the state of an object
• Selector/ Accessors : an operation that accesses the state of an
object but does not alter the state
• Iterator: an operation that permits all parts of an object to be
accessed in some well-defined order
•Two other kinds of operations are common; they
represent the infrastructure necessary to create and
destroy instances of a class.
• Constructor: an operation that creates an object and/or
initializes its state
• Destructor: an operation that frees the state of an object
and/or destroys the object itself
Categories of methods
• accessor: A method that lets clients examine object state.
• Examples: getX(), distanceFromOrigin
• often has a non-void return type
• mutator: A method that modifies an object's state.
• Examples: setLocation, translate
• helper: Assists some other method in performing its task.
• often declared as private so outside clients cannot call it
Identity
• Khoshafian and Copeland offer the following definition for identity:
“Identity is that property of an object which distinguishes it from all
other objects”
• “most programming and database languages use variable names to
distinguish temporary objects, mixing addressability and identity. Most
database systems use identifier keys to distinguish persistent objects,
mixing data value and identity.”
• The failure to recognize the difference between the name of an object
and the object itself is the source of many kinds of errors in object
oriented programming.
The Nature of a Class
• Webster’s Third New International Dictionary defines a class
as “a group, set, or kind marked by common attributes or a
common attribute; a group division, distinction, or rating
based on quality, degree of competence, or condition”
• In the context of object-oriented analysis and design, we
define a class as follows:
• A class is a set of objects that share a common structure,
common behaviour, and common semantics.
• A single object is simply an instance of a class.
Object Oriented Programming Concepts Def
What isn’t a class?
An object is not a class. Objects that share no common
structure and behaviour cannot be grouped in a class because, by
definition, they are unrelated except by their general nature as
objects.
Interface and Implementation
• The interface of a class provides its outside view and
therefore emphasizes the abstraction while hiding its
structure and the secrets of its behaviour.
• This interface primarily consists of the declarations of all the
operations applicable to instances of this class, but it may also
include the declaration of other classes, constants, variables,
and exceptions as needed to complete the abstraction.
• By contrast, the implementation of a class is its inside view,
which encompasses the secrets of its behaviour.
• The implementation of a class primarily consists of the
implementation of all of the operations defined in the
interface of the class.
Summary
•Abstraction
• Shows only the essential attributes and hide unnecessary details from
the user.
• Purpose : Hide the complexity from the user
Class
•Interface
• The “visible” part of the class that the program
• Can interact with
•Implementation
• The internal part of the class with
the code that performs the functionality
Object Oriented Programming Concepts Def
23
Reference
• Object-Oriented Analysis and Design
with Applications, Third Edition,
Grady Booch, Robert A.
Maksimchuk, Michael W. Engle,
Bobbi J. Young, Ph.D., Jim
Conallen,Kelli A. Houston

More Related Content

PPTX
Objects and Classes.pptx
PPTX
Objects and Classes.pptx
PPTX
Objects and Classes BRIEF.pptx
PDF
Object-Oriented Programming in Java (Module 1)
PPT
General OOP concept [by-Digvijay]
PPT
Ooad ch 1_2
PPTX
07 intro2 oop
PPTX
CPP Object Oriented Concepts(OOPS).pptx
Objects and Classes.pptx
Objects and Classes.pptx
Objects and Classes BRIEF.pptx
Object-Oriented Programming in Java (Module 1)
General OOP concept [by-Digvijay]
Ooad ch 1_2
07 intro2 oop
CPP Object Oriented Concepts(OOPS).pptx

Similar to Object Oriented Programming Concepts Def (20)

PPT
Lukito Edi Nugroho - Object Orientation Concepts
PPT
Object-oriented concepts
PDF
Object oriented software engineering concepts
DOCX
Ooad notes
PPTX
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
PPTX
bbbnnjxhxshjsjskshsjsjshssddhjddjdjddhgd
PPTX
Principles of Agile Topic. Basic understanding of Agile principles.
PPTX
Oo concepts and class modeling
PPTX
OOSD1-unit1_1_16_09.pptx
PPTX
object oriented programing lecture 1
DOCX
Sample UML Diagram – Employee ClassEmployee- count int- .docx
PPT
Lecture 2
PPTX
What is Object Orientation?
PPTX
Introduction
PDF
Abap object-oriented-programming-tutorials
PPT
Ooad ch 2
PPT
Lecture01
PPTX
Std 12 computer chapter 6 object oriented concepts (part 1)
PPTX
Advanced Topics on Database - Unit-2 AU17
PPTX
COMP111-Week-1_138439.pptx
Lukito Edi Nugroho - Object Orientation Concepts
Object-oriented concepts
Object oriented software engineering concepts
Ooad notes
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
bbbnnjxhxshjsjskshsjsjshssddhjddjdjddhgd
Principles of Agile Topic. Basic understanding of Agile principles.
Oo concepts and class modeling
OOSD1-unit1_1_16_09.pptx
object oriented programing lecture 1
Sample UML Diagram – Employee ClassEmployee- count int- .docx
Lecture 2
What is Object Orientation?
Introduction
Abap object-oriented-programming-tutorials
Ooad ch 2
Lecture01
Std 12 computer chapter 6 object oriented concepts (part 1)
Advanced Topics on Database - Unit-2 AU17
COMP111-Week-1_138439.pptx
Ad

Recently uploaded (20)

PPTX
endocrine - management of adrenal incidentaloma.pptx
PPTX
Fluid dynamics vivavoce presentation of prakash
PPT
Presentation of a Romanian Institutee 2.
PPTX
Welcome-grrewfefweg-students-of-2024.pptx
PPTX
INTRODUCTION TO PAEDIATRICS AND PAEDIATRIC HISTORY TAKING-1.pptx
PPT
THE CELL THEORY AND ITS FUNDAMENTALS AND USE
PPTX
POULTRY PRODUCTION AND MANAGEMENTNNN.pptx
PPTX
Seminar Hypertension and Kidney diseases.pptx
PPT
1. INTRODUCTION TO EPIDEMIOLOGY.pptx for community medicine
PDF
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
PDF
Placing the Near-Earth Object Impact Probability in Context
PDF
CHAPTER 3 Cell Structures and Their Functions Lecture Outline.pdf
PDF
Worlds Next Door: A Candidate Giant Planet Imaged in the Habitable Zone of ↵ ...
PPTX
Lesson-1-Introduction-to-the-Study-of-Chemistry.pptx
PPT
Animal tissues, epithelial, muscle, connective, nervous tissue
PDF
Unit 5 Preparations, Reactions, Properties and Isomersim of Organic Compounds...
PDF
CHAPTER 2 The Chemical Basis of Life Lecture Outline.pdf
PPT
LEC Synthetic Biology and its application.ppt
PPTX
Biomechanics of the Hip - Basic Science.pptx
PDF
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
endocrine - management of adrenal incidentaloma.pptx
Fluid dynamics vivavoce presentation of prakash
Presentation of a Romanian Institutee 2.
Welcome-grrewfefweg-students-of-2024.pptx
INTRODUCTION TO PAEDIATRICS AND PAEDIATRIC HISTORY TAKING-1.pptx
THE CELL THEORY AND ITS FUNDAMENTALS AND USE
POULTRY PRODUCTION AND MANAGEMENTNNN.pptx
Seminar Hypertension and Kidney diseases.pptx
1. INTRODUCTION TO EPIDEMIOLOGY.pptx for community medicine
Cosmic Outliers: Low-spin Halos Explain the Abundance, Compactness, and Redsh...
Placing the Near-Earth Object Impact Probability in Context
CHAPTER 3 Cell Structures and Their Functions Lecture Outline.pdf
Worlds Next Door: A Candidate Giant Planet Imaged in the Habitable Zone of ↵ ...
Lesson-1-Introduction-to-the-Study-of-Chemistry.pptx
Animal tissues, epithelial, muscle, connective, nervous tissue
Unit 5 Preparations, Reactions, Properties and Isomersim of Organic Compounds...
CHAPTER 2 The Chemical Basis of Life Lecture Outline.pdf
LEC Synthetic Biology and its application.ppt
Biomechanics of the Hip - Basic Science.pptx
Looking into the jet cone of the neutrino-associated very high-energy blazar ...
Ad

Object Oriented Programming Concepts Def

  • 2. Benefits of the Object Model • First, the use of the object model helps us to exploit the expressive power of object-based and object-oriented programming languages, using the class and object as basic building blocks. • Second, the use of the object model encourages the reuse not only of software but of entire designs, leading to the creation of reusable application frameworks • Third, the use of the object model produces systems that are built on stable intermediate forms, which are more resilient to change.
  • 3. What Is and What Isn’t an Object • an object is any of the following: • A tangible and/or visible thing • Something that may be comprehended intellectually • Something toward which thought or action is directed • Jacobson et al. define control objects as “the ones that unite courses of events and thus will carry on communication with other objects” [62]. • This leads us to the more refined definition of Smith and Tockey, who suggest that “an object represents an individual, identifiable item, unit, or entity, either real or abstract, with a well-defined role in the problem domain”
  • 4. • Some objects may have crisp conceptual boundaries yet represent intangible events or processes. • For example, a chemical process in a manufacturing plant may be treated as an object because it has a crisp conceptual boundary, interacts with certain other objects through a well-ordered collection of operations that unfolds over time, and exhibits a well-defined behavior.
  • 5. An object is an entity that has state, behaviour, and identity. The structure and behaviour of similar objects are defined in their common class. The terms instance and object are interchangeable.
  • 6. State The state of an object encompasses all of the (usually static) properties of the object plus the current (usually dynamic) values of each of these properties. Employee Class with Attributes Employee Objects Tom and Kaitlyn
  • 7. Behaviour • Behaviour is how an object acts and reacts, in terms of its state changes and message passing. • In other words, the behaviour of an object represents its outwardly visible activity. • An operation is some action that one object performs on another in order to elicit a reaction. • For example, a client might invoke the operations append and pop to grow and shrink a queue object, respectively. • A client might also invoke the operation length, which returns a value denoting the size of the queue object but does not alter the state of the queue itself. • Message passing is one part of the equation that defines the behaviour of an object; our definition for behaviour also notes that the state of an object affects its behaviour as well.
  • 8. Operations • An operation denotes a service that a class offers to its clients. In practice, we have found that a client typically performs five kinds of operations on an object. • The three most common kinds of operations are the following: • Modifier/ Mutators : an operation that alters the state of an object • Selector/ Accessors : an operation that accesses the state of an object but does not alter the state • Iterator: an operation that permits all parts of an object to be accessed in some well-defined order
  • 9. •Two other kinds of operations are common; they represent the infrastructure necessary to create and destroy instances of a class. • Constructor: an operation that creates an object and/or initializes its state • Destructor: an operation that frees the state of an object and/or destroys the object itself
  • 10. Categories of methods • accessor: A method that lets clients examine object state. • Examples: getX(), distanceFromOrigin • often has a non-void return type • mutator: A method that modifies an object's state. • Examples: setLocation, translate • helper: Assists some other method in performing its task. • often declared as private so outside clients cannot call it
  • 11. Identity • Khoshafian and Copeland offer the following definition for identity: “Identity is that property of an object which distinguishes it from all other objects” • “most programming and database languages use variable names to distinguish temporary objects, mixing addressability and identity. Most database systems use identifier keys to distinguish persistent objects, mixing data value and identity.” • The failure to recognize the difference between the name of an object and the object itself is the source of many kinds of errors in object oriented programming.
  • 12. The Nature of a Class • Webster’s Third New International Dictionary defines a class as “a group, set, or kind marked by common attributes or a common attribute; a group division, distinction, or rating based on quality, degree of competence, or condition” • In the context of object-oriented analysis and design, we define a class as follows: • A class is a set of objects that share a common structure, common behaviour, and common semantics. • A single object is simply an instance of a class.
  • 14. What isn’t a class? An object is not a class. Objects that share no common structure and behaviour cannot be grouped in a class because, by definition, they are unrelated except by their general nature as objects.
  • 15. Interface and Implementation • The interface of a class provides its outside view and therefore emphasizes the abstraction while hiding its structure and the secrets of its behaviour. • This interface primarily consists of the declarations of all the operations applicable to instances of this class, but it may also include the declaration of other classes, constants, variables, and exceptions as needed to complete the abstraction. • By contrast, the implementation of a class is its inside view, which encompasses the secrets of its behaviour. • The implementation of a class primarily consists of the implementation of all of the operations defined in the interface of the class.
  • 16. Summary •Abstraction • Shows only the essential attributes and hide unnecessary details from the user. • Purpose : Hide the complexity from the user
  • 17. Class •Interface • The “visible” part of the class that the program • Can interact with •Implementation • The internal part of the class with the code that performs the functionality
  • 19. 23 Reference • Object-Oriented Analysis and Design with Applications, Third Edition, Grady Booch, Robert A. Maksimchuk, Michael W. Engle, Bobbi J. Young, Ph.D., Jim Conallen,Kelli A. Houston