Chapter4 1-ClassesAndObjects
Chapter4 1-ClassesAndObjects
• Abstraction • Inheritance
• Encapsulation • Overriding
• Information Hiding • Polymorphism
• Message Passing • Dynamic Binding
• Overloading
• Information hiding, Message passing and
Overloading are covered by chapter 5 of this
course.
• Inheritance, Polymorphism, Overriding and
Dynamic binding are discussed in CSC 113.
Page 8 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP
Abstraction Principle
• Data Abstraction • Functionality Abstraction
– In order to process – Modeling functionality
something from the real suffers from
world we have to extract • unnecessary functionality
the essential characteristics may be extracted,
of that object. • or alternatively, an
– Data abstraction is the important piece of
process of: functionality may be
omitted.
• Refining away the
unimportant details of an – Functionality abstraction is
object, the process of determining
• Keeping only the useful which functionality is
characteristics that define important. view
the object.
– For example, depending on
how a car is viewed (e.g. in
terms of something to be
registered, or alternatively
something to be repaired, view view
etc.) different sets of
characteristics will emerge
as being important.
Page 9 Dr. S. GANNOUNI & Dr. A. TOUIR Introduction to OOP
Encapsulation Principle
• Abstraction involves reducing a real world
entity to its abstraction essential defining
characteristics.
// Methods (services)
Modifiers
Modifiers Data
DataType
Type Name
Name