SlideShare a Scribd company logo
2. The Object Model
Elements of the Object Model
Kinds of Programming Paradigms:
• Jenkins & Glasgow observe that -
–Most programmers work in one language and
use only one programming style.
–They program in a paradigm enforced by the
language they use.
–Frequently they have not been exposed to
alternate ways of thinking about a problem
and
–Hence have difficulty in seeing the advantage
of choosing a style more appropriate to the
problem at hand.
• Bobrow and stefik define a programming
style as –
–a way of organizing programs on the basis
some conceptual model of programming and
an appropriate language to make programs
written in the style clear.
• They further suggest that there are five main
kinds of programming styles:
–Procedure-oriented – used algorithms only =
best for the design of computation-intense
operations.
–Object-oriented – used classes and objects =
best for broadest set of applications.
–Logic-oriented – Goals, often expressed in a
predicate calculus.
–Rule-oriented – if-than rules = best for the
design of a knowledge base.
–Constraints-oriented – Invariant relationships
In computing, object model has two
related but distinct meanings:
• The properties of objects in general, in a specific
computer programming language, technology,
notation or methodology that uses them. For
example, the Java object model, the
Component Object Model(COM), or the object
model of Object Modeling Technique OMT).
Such object models are usually defined using
concepts such as class, message, inheritance,
polymorphism, and encapsulation. There is an
extensive literature on formalized object models
as a subset of the
formal semantics of programming languages.
• A collection of objects or classes through which a
program can examine and manipulate some
specific parts of its world. In other words, the
object-oriented interface to some service or system.
Such an interface is said to be the object model of
the represented service or system. For example,
the Document Object Model (DOM) is a collection
of objects that represent a page in a web browser,
used by script programs to examine and
dynamically change the page. There is a
Microsoft Excel object model for controlling
Microsoft Excel from another program, and the
(AStronomy Common Object Model) ASCOM
Telescope Driver is an object model for controlling
an astronomical telescope.
• There are four major elements of this
object model:
1.Encapsulation
2.Abstraction
3.Modularity
4.Hierarchy
• There are another three minor
elements of the object model:
1. Typing
2. Concurrency
3. Persistence
Abstraction
• Abstraction is the process of distilling the data
down to its essential.
• But in Object Schema, the abstract data model
is implemented as a graph.
• The following figure shows such a graph
structure for a genealogical database
Abstraction
• Consider a real-world objects such as radio.
• As far as a user is concerned, the radio is one unit.
• In reality, it consists of many units, e.g., Station
Management, Power-management, and Volume Control.
• However, the user is not intimidated by all these complex
subunits and their working.
• To him, the radio should work as one abstract unit
( with external buttons to represent these sub-units).
• Similarly a class is one abstract unit. In order to perform
a task that involve an object of the class, a message must
be sent to the object asking it to execute the desired
operation.
9
Abstraction
• Abstraction is the process of modeling only relevant
features
– Hide unnecessary details which are irrelevant for
current purpose (and/or user), like eye color
• Reduces complexity and aids understanding
• Done via class, inheritance, association, and
aggregation concepts
Questions:
1.Define the kinds of Abstractions.
10
Encapsulation
• Encapsulation is the process of
compartmentalization the elements of an
abstraction that constitute its structure and
behavior.
• Encapsulation is an attribute of object design.
• Encapsulation serves to separate the
interface of an abstraction and its
implementation.
• So, encapsulation is the integration
addition/combination of data and operations
into a class
• Supports information hiding by concealing
implementation of the object.
11
• Allows us to call a function without knowing, or
caring, how it’s implemented
–sqrt(x)
• The instructions are encapsulated within a
function.
• Programming languages aren’t quite so strict
and allow differing levels of access to the
object’s data. So, includes three levels of
access in programming:
– Public = All Objects can access it
– Private = Access is limited to member of the same
class.
– Protected = Access is limited to member of the
same class.
12
• In OO, a class is used as a unit to group
related attributes and operations together.
• Interact with the data stored in the variables
that represent the attributes of the class only
through the operations of that class.
• So, Encapsulation is the grouping of related
ideas into one unit, which can thereafter be
referred to by a single name.
13
• Thus the operations act as interfaces of the object of
the class. For example:
14
empID
empName
dateOfJoining
getEmpID()
setEmpName()
getEmpName()
setDOJ()
getDOJ()
setEmpID()
Employee
Here the class is the
employee
• So, the employee class have the following operations:
setEmpID(employeeid:int) = assigns employee to empID
getEmpID():int = returns the value of empID
setEmpName(employeename:string)= assigns employeename to
empName
getEmpName():String = returns the name of the employee
setDOJ(doj:date) = assign doj to date of joining
getDOJ:date = returns the date of joining
• For an object e1 of the type Employee, if it is necessary to set any value to
attributes; then the methods – setEmpID(employeeid:int) ………………..
must be used.
• Similarly, necessary to know the value of any attributes, then the get
operations have to be used.
• So, these operations act as the interface of the object e1 with the outside
world.
• Thus, the attributes and operations are encapsulated within a class, and
interaction with the attributes is done through the interface which is
provided by the enacpsulation. 15
Principle of Abstraction
A process allowing to focus on most important aspects
while ignoring less important details.
Abstraction allows us to manage complexity by
concentrating on essential aspects making an entity
different from others.
An example of an order processing abstraction
Customer
Salesman
Product
16
Modularity
• Modularity is the property of a system that has been
decomposed into a set of cohesive and loosely coupled
modules.
• So, it is a general systems concepts, typically defined
as a continuum describing the degree to which a
system’s components may be separated and
recombined.
17
Concept of Modularity used in different discipline
Concept Technology Mathematics
1. Domain Specific X
2. Hierarchical nested X X
3. Informationally X
encapsulated
4. Recombinability X X
5. Expanndability X X
6. Module X X
Principle : Modularity
Modularity breaks up complex systems into small,
self-contained pieces that can be managed
independently.
Order Processing System
Order Entry
Order Fulfillment
Billing
19
Hierarchy
• Subclasses inherit all of the properties and
operations defined for the superclass, and
will usually add more
• A hierarchy is an arrangement of items
(objects, names, values etc.) in which the
items are represented as being “above” , “
below” or “ at the same level as” one
another.
• It is a simply an ordered set or an acyclic
graph. So, it is called Inheritance.
20
•So, Inheritance is a relationships between
a super class and its subclasses
Inheritance means that all the attributes and operations of
an abstract object are available in the specialized object
below. The triangle in the diagram indicates inheritance.
The point of the triangle indicates where operations and
attributes are inherited from.
Okay, so let's have some more practical examples for
those of you who have to do real work. Firstly, the
frighteningly dull student-lecturer example. You can
do the same with the equally dull employee-customer
example.
Inheritance
Wheeled
Vehicle
Two wheeled
Not Wheeled
Four wheeled Tank
Generalization
Specialization
Class
Superclass
Subclass
23
What is a Class?
• “A description of a set of objects that share the
same attributes, operations, methods,
relationships, and semantics. A class may use
a set of interfaces to specify collections of
operations it provides to its environment.”
• Hence a class is a group of similar objects
24
Chapter 02 The Object Model_Software E.ppt
Class Example
Printers
information
behaviour
Attribute
Definition
Attribute is a named property of a class describing a range of values
that instances of the class may hold for that property.
An attribute has a type and defines the type of its instances.
Only the object is able to change the values of its own attributes.
The set of attribute values defines the state of the object.
27
Attribute Examples
Printer
serialNumber
memory
status
class
attribute
:Printer
serialNumber=067l
memory=256Mb
status=busy
:Printer
serialNumber=125t
memory=128Mb
status=idle
object
attribute value
28
Operation
Definition
Operation is the implementation of a service that can be requested
from any object of a given class.
An operation could be:
1) a question - does not change the values of the attributes
2) a command – may change the values of the attributes
29
Operation Example
Printer
printFile
stopPrinting
removeFileInQueue
class
operation
30
Interface
1)minimum information
required to use an object
2)allows users to access
the object’s knowledge
3)must be exposed
4)provides no direct
access to object
internals
Implementation
1) information required to
make an object work
properly
2) a combination of the
behavior and the resources
required to satisfy the goal
of the behavior
3) ensures the integrity of the
information upon which the
behavior depends
Chapter 02 The Object Model_Software E.ppt

More Related Content

Similar to Chapter 02 The Object Model_Software E.ppt (20)

PPTX
OOP Presentation.pptx
DurgaPrasadVasantati
 
PPT
34. uml
karzansaid
 
PPTX
1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas
18130208
 
PPTX
CPP Object Oriented Concepts(OOPS).pptx
adityakumardas16
 
PDF
Lecture 2 cst 205-281 oop
ktuonlinenotes
 
PPTX
OOSD1-unit1_1_16_09.pptx
ShobhitSrivastava15887
 
PPTX
OOP Lecture 01.pptx
BilalWarraich15
 
PPT
Software Engineering Lec5 oop-uml-i
Taymoor Nazmy
 
PPT
Object -oriented analysis and design.ppt
pierrerj05
 
PPTX
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
RajendraKumarRajouri1
 
PPTX
Abstraction file
Luis Goldster
 
PPTX
Abstraction file
Tony Nguyen
 
PPTX
Abstraction file
Fraboni Ec
 
PPTX
Abstraction file
Harry Potter
 
PPTX
Abstraction file
Hoang Nguyen
 
PPTX
Abstraction file
James Wong
 
PPTX
Abstraction file
Young Alista
 
PPT
Oomd unit1
VivekChaudhary93
 
PPT
Lecture#01, object orientation
babak danyal
 
PPT
Oops Concepts
guest1aac43
 
OOP Presentation.pptx
DurgaPrasadVasantati
 
34. uml
karzansaid
 
1a-OO-Basics.pptx lạoanfanfanfjasnfjnfkaskfklas
18130208
 
CPP Object Oriented Concepts(OOPS).pptx
adityakumardas16
 
Lecture 2 cst 205-281 oop
ktuonlinenotes
 
OOSD1-unit1_1_16_09.pptx
ShobhitSrivastava15887
 
OOP Lecture 01.pptx
BilalWarraich15
 
Software Engineering Lec5 oop-uml-i
Taymoor Nazmy
 
Object -oriented analysis and design.ppt
pierrerj05
 
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
RajendraKumarRajouri1
 
Abstraction file
Luis Goldster
 
Abstraction file
Tony Nguyen
 
Abstraction file
Fraboni Ec
 
Abstraction file
Harry Potter
 
Abstraction file
Hoang Nguyen
 
Abstraction file
James Wong
 
Abstraction file
Young Alista
 
Oomd unit1
VivekChaudhary93
 
Lecture#01, object orientation
babak danyal
 
Oops Concepts
guest1aac43
 

Recently uploaded (20)

PDF
chapter 5.pdf cyber security and Internet of things
PalakSharma980227
 
PPTX
Operations Profile SPDX_Update_20250711_Example_05_03.pptx
Shane Coughlan
 
PPTX
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
PPTX
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
PDF
intro_to_cpp_namespace_robotics_corner.pdf
MohamedSaied877003
 
PDF
Meet in the Middle: Solving the Low-Latency Challenge for Agentic AI
Alluxio, Inc.
 
PDF
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
 
PPTX
Library_Management_System_PPT111111.pptx
nmtnissancrm
 
PDF
10 Salesforce Consulting Companies in Sydney.pdf
DianApps Technologies
 
PDF
Message Level Status (MLS): The Instant Feedback Mechanism for UAE e-Invoicin...
Prachi Desai
 
PDF
ESUG 2025: Pharo 13 and Beyond (Stephane Ducasse)
ESUG
 
PDF
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
PDF
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
PDF
Everything you need to know about pricing & licensing Microsoft 365 Copilot f...
Q-Advise
 
PPTX
How Odoo ERP Enhances Operational Visibility Across Your Organization.pptx
pintadoxavier667
 
PPT
24-BuildingGUIs Complete Materials in Java.ppt
javidmiakhil63
 
PDF
Code and No-Code Journeys: The Maintenance Shortcut
Applitools
 
PDF
Ready Layer One: Intro to the Model Context Protocol
mmckenna1
 
PPTX
How Can Reporting Tools Improve Marketing Performance.pptx
Varsha Nayak
 
PDF
Australian Enterprises Need Project Service Automation
Navision India
 
chapter 5.pdf cyber security and Internet of things
PalakSharma980227
 
Operations Profile SPDX_Update_20250711_Example_05_03.pptx
Shane Coughlan
 
Transforming Insights: How Generative AI is Revolutionizing Data Analytics
LetsAI Solutions
 
Function & Procedure: Function Vs Procedure in PL/SQL
Shani Tiwari
 
intro_to_cpp_namespace_robotics_corner.pdf
MohamedSaied877003
 
Meet in the Middle: Solving the Low-Latency Challenge for Agentic AI
Alluxio, Inc.
 
AI Prompts Cheat Code prompt engineering
Avijit Kumar Roy
 
Library_Management_System_PPT111111.pptx
nmtnissancrm
 
10 Salesforce Consulting Companies in Sydney.pdf
DianApps Technologies
 
Message Level Status (MLS): The Instant Feedback Mechanism for UAE e-Invoicin...
Prachi Desai
 
ESUG 2025: Pharo 13 and Beyond (Stephane Ducasse)
ESUG
 
UITP Summit Meep Pitch may 2025 MaaS Rebooted
campoamor1
 
ERP Consulting Services and Solutions by Contetra Pvt Ltd
jayjani123
 
Everything you need to know about pricing & licensing Microsoft 365 Copilot f...
Q-Advise
 
How Odoo ERP Enhances Operational Visibility Across Your Organization.pptx
pintadoxavier667
 
24-BuildingGUIs Complete Materials in Java.ppt
javidmiakhil63
 
Code and No-Code Journeys: The Maintenance Shortcut
Applitools
 
Ready Layer One: Intro to the Model Context Protocol
mmckenna1
 
How Can Reporting Tools Improve Marketing Performance.pptx
Varsha Nayak
 
Australian Enterprises Need Project Service Automation
Navision India
 
Ad

Chapter 02 The Object Model_Software E.ppt

  • 2. Elements of the Object Model Kinds of Programming Paradigms: • Jenkins & Glasgow observe that - –Most programmers work in one language and use only one programming style. –They program in a paradigm enforced by the language they use. –Frequently they have not been exposed to alternate ways of thinking about a problem and –Hence have difficulty in seeing the advantage of choosing a style more appropriate to the problem at hand.
  • 3. • Bobrow and stefik define a programming style as – –a way of organizing programs on the basis some conceptual model of programming and an appropriate language to make programs written in the style clear. • They further suggest that there are five main kinds of programming styles: –Procedure-oriented – used algorithms only = best for the design of computation-intense operations. –Object-oriented – used classes and objects = best for broadest set of applications.
  • 4. –Logic-oriented – Goals, often expressed in a predicate calculus. –Rule-oriented – if-than rules = best for the design of a knowledge base. –Constraints-oriented – Invariant relationships
  • 5. In computing, object model has two related but distinct meanings: • The properties of objects in general, in a specific computer programming language, technology, notation or methodology that uses them. For example, the Java object model, the Component Object Model(COM), or the object model of Object Modeling Technique OMT). Such object models are usually defined using concepts such as class, message, inheritance, polymorphism, and encapsulation. There is an extensive literature on formalized object models as a subset of the formal semantics of programming languages.
  • 6. • A collection of objects or classes through which a program can examine and manipulate some specific parts of its world. In other words, the object-oriented interface to some service or system. Such an interface is said to be the object model of the represented service or system. For example, the Document Object Model (DOM) is a collection of objects that represent a page in a web browser, used by script programs to examine and dynamically change the page. There is a Microsoft Excel object model for controlling Microsoft Excel from another program, and the (AStronomy Common Object Model) ASCOM Telescope Driver is an object model for controlling an astronomical telescope.
  • 7. • There are four major elements of this object model: 1.Encapsulation 2.Abstraction 3.Modularity 4.Hierarchy • There are another three minor elements of the object model: 1. Typing 2. Concurrency 3. Persistence
  • 8. Abstraction • Abstraction is the process of distilling the data down to its essential. • But in Object Schema, the abstract data model is implemented as a graph. • The following figure shows such a graph structure for a genealogical database
  • 9. Abstraction • Consider a real-world objects such as radio. • As far as a user is concerned, the radio is one unit. • In reality, it consists of many units, e.g., Station Management, Power-management, and Volume Control. • However, the user is not intimidated by all these complex subunits and their working. • To him, the radio should work as one abstract unit ( with external buttons to represent these sub-units). • Similarly a class is one abstract unit. In order to perform a task that involve an object of the class, a message must be sent to the object asking it to execute the desired operation. 9
  • 10. Abstraction • Abstraction is the process of modeling only relevant features – Hide unnecessary details which are irrelevant for current purpose (and/or user), like eye color • Reduces complexity and aids understanding • Done via class, inheritance, association, and aggregation concepts Questions: 1.Define the kinds of Abstractions. 10
  • 11. Encapsulation • Encapsulation is the process of compartmentalization the elements of an abstraction that constitute its structure and behavior. • Encapsulation is an attribute of object design. • Encapsulation serves to separate the interface of an abstraction and its implementation. • So, encapsulation is the integration addition/combination of data and operations into a class • Supports information hiding by concealing implementation of the object. 11
  • 12. • Allows us to call a function without knowing, or caring, how it’s implemented –sqrt(x) • The instructions are encapsulated within a function. • Programming languages aren’t quite so strict and allow differing levels of access to the object’s data. So, includes three levels of access in programming: – Public = All Objects can access it – Private = Access is limited to member of the same class. – Protected = Access is limited to member of the same class. 12
  • 13. • In OO, a class is used as a unit to group related attributes and operations together. • Interact with the data stored in the variables that represent the attributes of the class only through the operations of that class. • So, Encapsulation is the grouping of related ideas into one unit, which can thereafter be referred to by a single name. 13
  • 14. • Thus the operations act as interfaces of the object of the class. For example: 14 empID empName dateOfJoining getEmpID() setEmpName() getEmpName() setDOJ() getDOJ() setEmpID() Employee Here the class is the employee
  • 15. • So, the employee class have the following operations: setEmpID(employeeid:int) = assigns employee to empID getEmpID():int = returns the value of empID setEmpName(employeename:string)= assigns employeename to empName getEmpName():String = returns the name of the employee setDOJ(doj:date) = assign doj to date of joining getDOJ:date = returns the date of joining • For an object e1 of the type Employee, if it is necessary to set any value to attributes; then the methods – setEmpID(employeeid:int) ……………….. must be used. • Similarly, necessary to know the value of any attributes, then the get operations have to be used. • So, these operations act as the interface of the object e1 with the outside world. • Thus, the attributes and operations are encapsulated within a class, and interaction with the attributes is done through the interface which is provided by the enacpsulation. 15
  • 16. Principle of Abstraction A process allowing to focus on most important aspects while ignoring less important details. Abstraction allows us to manage complexity by concentrating on essential aspects making an entity different from others. An example of an order processing abstraction Customer Salesman Product 16
  • 17. Modularity • Modularity is the property of a system that has been decomposed into a set of cohesive and loosely coupled modules. • So, it is a general systems concepts, typically defined as a continuum describing the degree to which a system’s components may be separated and recombined. 17
  • 18. Concept of Modularity used in different discipline Concept Technology Mathematics 1. Domain Specific X 2. Hierarchical nested X X 3. Informationally X encapsulated 4. Recombinability X X 5. Expanndability X X 6. Module X X
  • 19. Principle : Modularity Modularity breaks up complex systems into small, self-contained pieces that can be managed independently. Order Processing System Order Entry Order Fulfillment Billing 19
  • 20. Hierarchy • Subclasses inherit all of the properties and operations defined for the superclass, and will usually add more • A hierarchy is an arrangement of items (objects, names, values etc.) in which the items are represented as being “above” , “ below” or “ at the same level as” one another. • It is a simply an ordered set or an acyclic graph. So, it is called Inheritance. 20 •So, Inheritance is a relationships between a super class and its subclasses
  • 21. Inheritance means that all the attributes and operations of an abstract object are available in the specialized object below. The triangle in the diagram indicates inheritance. The point of the triangle indicates where operations and attributes are inherited from.
  • 22. Okay, so let's have some more practical examples for those of you who have to do real work. Firstly, the frighteningly dull student-lecturer example. You can do the same with the equally dull employee-customer example.
  • 23. Inheritance Wheeled Vehicle Two wheeled Not Wheeled Four wheeled Tank Generalization Specialization Class Superclass Subclass 23
  • 24. What is a Class? • “A description of a set of objects that share the same attributes, operations, methods, relationships, and semantics. A class may use a set of interfaces to specify collections of operations it provides to its environment.” • Hence a class is a group of similar objects 24
  • 27. Attribute Definition Attribute is a named property of a class describing a range of values that instances of the class may hold for that property. An attribute has a type and defines the type of its instances. Only the object is able to change the values of its own attributes. The set of attribute values defines the state of the object. 27
  • 29. Operation Definition Operation is the implementation of a service that can be requested from any object of a given class. An operation could be: 1) a question - does not change the values of the attributes 2) a command – may change the values of the attributes 29
  • 31. Interface 1)minimum information required to use an object 2)allows users to access the object’s knowledge 3)must be exposed 4)provides no direct access to object internals
  • 32. Implementation 1) information required to make an object work properly 2) a combination of the behavior and the resources required to satisfy the goal of the behavior 3) ensures the integrity of the information upon which the behavior depends