Upload
norazlina-abdullah
View
213
Download
0
Embed Size (px)
Citation preview
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 1/16
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 2/16
At the end of this chapter you will
know the concepts of
• Languages
• Principles of OOPs
•
Real world and computer software• Object factory
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 3/16
Object oriented programming
• Provides easy approach
• Machine independent
• Understanding is very easy
High levellanguages
• Many instructions are written
• Instructions are grouped together to form functions
• Concentrates much on data items rather than functions
Procedure
oriented
• Modular approach
• Standardize the program by creating partition memoryfor both data and function
• Reusability of code
Object
oriented
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 4/16
Principles of Object oriented
programming
Objects
Classes
Data
Abstraction
Encapsulation
Data Hiding
Inheritance
Polymorphism
Dynamic
Binding
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 5/16
Object
• Unique identity which contains data and
functions (Characteristics and behavior)
Characteristic :
Colour and
shape
BehaviorWrite
Characteris
tics are considered as data members
Behavior is considered as functions
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 6/16
Classes
• Class is a set of similar objects
• Each object has its own attribute and common
behavior
Rainbow is a class that contains amplitude, frequency, wavelength.
Objects are the different colors
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 7/16
Data Abstraction
• Act of representing the essential features
without including the background details
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 8/16
Encapsulation
• Wrapping up of data and function into a single
unit called class is encapsulation.
DATA + FUNCTION = CLASS
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 9/16
Data Hiding
• Data that cannot be directly accessed outside
the class although they are available in the
same program.
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 10/16
Inheritance
• Process by which objects of one class can link
and share some common properties of objects
from another class.
10
10 A 10 B 10 c
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 11/16
Polymorphism
• Process of using a function for more than one
purpose.
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 12/16
Dynamic Binding
• Process to link the function call with function
signature during run time.
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 13/16
Object Factory
• Class is a prototype of an object
• Each objects has its own properties and
behavior
• As the class produces objects of similar type it
is termed as object factory
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 14/16
Message passing
• Objects interact with each other
• They share the common properties and
behavior
• This concept is message passing
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 15/16
Question session
• In OOP stress is given on _______
• A _____ is an object maker
• Combining data and function to an single entity is
called _______• Object acquiring the properties of another object
is called ______
•
In procedural programming the stress is on _____• Set of objects that have common attributes and
behavior is called________
7/27/2019 chapter1-120622030648-phpapp01.pptx
http://slidepdf.com/reader/full/chapter1-120622030648-phpapp01pptx 16/16
Question answers
What is OOP ?
Name any two OOP languages
Name the principles of OOP
Define object
Define a class
What is data hiding
Which technique can we adopt for data hiding ?
What is polymorphism
What is message passing?
Why is class called as object factory.