SlideShare a Scribd company logo
1 of 17
Download to read offline
Development Software 2 (DOS200S)
2013
OBJECT ORIENTED
PROGRAMMING CONCEPTS
Compiled By WH Olivier 2013/01/291
Introduction Classes & Objects
2013/01/29Compiled By WH Olivier2
In the real world, an object can be anything that we can see
around us. An object can be of a certain type. A dog, for
instance is a type of animal.
Animals is characterized by the way they look and the way they
behave.
A dog belong to the animal class and therefore inherits the
properties and behavior of an animal.
A Dalmatian again, is a type of dog and would inherit the
properties and the behavior of a dog.
Therefore, we can differentiate between a class and an
object.
A Class is a blueprint or template for an object. A class
specifies or defines an objects properties and behavior.
An Object is an instance of a class or type. Two dogs
would possess different values for their color and size
properties.
Classes & Objects cont…
2013/01/29Compiled By WH Olivier3
A Car Class
2013/01/29Compiled By WH Olivier4
 The creation of a car typically begins as
engineering drawings. The drawings would
include all the features, components and
properties of the car. Included in the design
would be all the mechanisms that will allow
the car to perform some function.
 For example, in order for a car to accelerate,
pressing the pedal would perform that
function.
 Unfortunately you cannot drive the drawings.
Building a car from that engineering drawings
would be creating an instance a car. The car
instance (object) would possess all the
features and properties of that car class.
 Once the car is there you can drive it, press
the accelerator pedal and that would course
the car to move faster
Read more… Introduction to classes and objects
Objects in Business
2013/01/29Compiled By WH Olivier5
 In the business world, companies deal with various
types of data. Data elements can be grouped
because they are related. For example all the data
about a customer are grouped and can be
represented as a Customer object.
 Other objects would be Employee, Order, Invoice, etc.
 Read More on Business Objects
 Business Objects
 Introduction to SAP Business Objects
 Program design use to be (and still is being used)
procedural. Procedural programming is creating a step
by step program where the program is a sequence of
instructions . Execution of the program starts at the
top and continues executing code line by line till the
bottom.
 Procedural programming also include functions
(smaller programmes) where the program can change
data which it has access to via the functions.
 With procedural programming the data and the
operations on the data is separate and data is being
passed and changed via the functions.
Compiled By WH Olivier
2013/01/296
 In Object Oriented Programming, things are being
viewed as entities called objects. Objects is the grouping
of data and its related functionality into one unit.
 OOP is a design philosophy used in different
programming languages. Everything within OOP is
grouped as a self sustainable object. OOP thus have a
re-usable component where objects can be used in many
other programs.
 An Object is entity or thing that can perform a set of
related activities / behavior (Eg. A CAR can drive, brake)
and have particular characteristics / properties ( Eg. A
Car have color, engine capacity)
 A Class is simply a representation of a type of object. It is
a blueprint for the describing the detail of an object.
Compiled By WH Olivier 2013/01/297
 The encapsulation is the inclusion within a program
object of all the resources need for the object to
function - basically, the methods and the data.
 In OOP the encapsulation is mainly achieved by
creating classes, the classes expose public methods
and properties.
 The class is kind of a container or capsule or a cell,
which encapsulate the set of methods, attribute and
properties to provide its indented functionalities to other
classes. In that sense, encapsulation also allows a
class to change its internal implementation without
hurting the overall functioning of the system.
Compiled By WH Olivier 2013/01/298
 Abstract classes, which declared with the abstract
keyword, cannot be instantiated. It can only be used
as a super-class for other classes that extend the
abstract class. Abstract class is the concept and
implementation gets completed when it is being
realized by a subclass. In addition to this a class can
inherit only from one abstract class (but a class may
implement many interfaces) and must override all its
abstract methods/ properties and may override virtual
methods/ properties.
Compiled By WH Olivier 2013/01/299
 Abstract data types can be implemented via classes and
object.
 When defining a new class and creating a object based
on that class, you created an abstract data type.
 Abstract data types are purely theoretical entities, used
(among other things) to simplify the description of abstract
algorithms, to classify and evaluate data structures, and
to formally describe the type systems of programming
languages.*
* http://en.wikipedia.org/wiki/Abstract_data_typeCompiled By WH Olivier 2013/01/2910
Inheritance & Composition
 The ability for a new class to be created from an
existing class by extending it is known as
inheritance.
 When one class contains another class as one of
its members, that is known as composition
 The following slide explains it by use of a diagram
Compiled By WH Olivier 2013/01/2911
dataType
-dMonth: int
-dDay: int
-dYear: int
+setDate(int, int, int) : void
+getDay() const: int
+getMonth() const: int
+getYear() const: int
+printDate() const: void
+dateType(int = 1, int = 1, int =1900)
partTimeEmployee Class
+print() const : void
+calculatePay() const: double
+setNameRateHours(string, string,
double, double) : void
+partTimeEmployee(string = “ “,
string = “ “, double = 0, double
= 0)-payRate : double
-hoursWorked : double
personType Class
+print() const : void
+setName(string, string: void
+getFirtsName() const: string
+getLastName() const : string
+personType(string = “ “, string = “
“)
-firstname : string
-lastname : string
personalInfo Class
+setPersonalInfo(string, string, int,
int, int, int) : void
+printPersonalInfo() const : void
+personalInfoType(string = “ “,
string = “ “, int = 1, int =1,
int = 1900, int = 0)
-name : personType
-bDay : dateType
-personID: int
INHERITANCE
partTimeEmployee
“is a” type of
personType
COMPOSITION
personalInfo “has a”
dateType as one of
its members
COMPOSITION
personalInfo “has a”
personType as one
of its members
INHERITANCE and COMPOSITION
Compiled By WH Olivier 2013/01/2912
 What is Polymorphism:
 Is a generic term which means ‘many shapes’
 Is also means the ability to that one operation be performed by a wide
range of different things. Simply stated, a operation will perform
differently depending on the way it is called and by which other thing
it is being requested.
 Method Overloading, Operator Overloading and Method Overriding is
the different techniques used to achieve polymorphism
 What is Method Overloading
 The ability to define several methods with the same name
 What is Operator Overloading
 Operators like +, -, *, == are treated as polymorphic functions and as
such have different behaviours depending on the way it is called
(arguments)
 What is Method Overriding
 Is used in inheritance where a sub-class can override a specific
implementation of a method that is already provided by the super-
class
Compiled By WH Olivier 2013/01/2913
Reference
 http://saimaterial.wordpress.com/2007/09/14/1what-
is-the-difference-between-object-oriented-
programming-and-procedural-programming/
 http://www.codeproject.com/Articles/22769/Introductio
n-to-Object-Oriented-Programming-Concep
 http://math.hws.edu/eck/cs124/downloads/OOP2_fro
m_Univ_KwaZulu-Natal.pdf
 http://www.deitel.com/books/cpphtp5/cpphtp5_03_sa
mple.pdf
 http://publib.boulder.ibm.com/infocenter/dmndhelp/v7r
5m1/index.jsp?topic=%2Fcom.ibm.wbpm.wid.data.do
c%2Fbo%2Ftopics%2Fcbo.html
 http://help.sap.com/saphelp_40b/helpdata/en/7e/5e11
a84a1611d1894c0000e829fbbd/content.htm
Compiled By WH Olivier 2013/01/2914
Double click below to open
2013/01/29Compiled By WH Olivier15
Double click below to open
2013/01/29Compiled By WH Olivier16
Double click below to open
2013/01/29Compiled By WH Olivier17

More Related Content

What's hot

Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Languagedheva B
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming conceptsrahuld115
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Sakthi Durai
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oopcolleges
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]Rome468
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programmingSachin Sharma
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop Kumar
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programmingAmit Soni (CTFL)
 
Object-oriented programming
Object-oriented programmingObject-oriented programming
Object-oriented programmingNeelesh Shukla
 
Lecture01 object oriented-programming
Lecture01 object oriented-programmingLecture01 object oriented-programming
Lecture01 object oriented-programmingHariz Mustafa
 
Chapter1 - Introduction to Object-Oriented Programming and Software Development
Chapter1 - Introduction to Object-Oriented Programming and Software DevelopmentChapter1 - Introduction to Object-Oriented Programming and Software Development
Chapter1 - Introduction to Object-Oriented Programming and Software DevelopmentEduardo Bergavera
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingMd. Tanvir Hossain
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperLee Greffin
 

What's hot (20)

Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 
Object oriented programming concepts
Object oriented programming conceptsObject oriented programming concepts
Object oriented programming concepts
 
Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1 Java Programming Paradigms Chapter 1
Java Programming Paradigms Chapter 1
 
Introduction to oop
Introduction to oopIntroduction to oop
Introduction to oop
 
C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]C++ [ principles of object oriented programming ]
C++ [ principles of object oriented programming ]
 
Basic concepts of object oriented programming
Basic concepts of object oriented programmingBasic concepts of object oriented programming
Basic concepts of object oriented programming
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Introduction to oop
Introduction to oop Introduction to oop
Introduction to oop
 
concept of oops
concept of oopsconcept of oops
concept of oops
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Object-oriented programming
Object-oriented programmingObject-oriented programming
Object-oriented programming
 
Advance oops concepts
Advance oops conceptsAdvance oops concepts
Advance oops concepts
 
Lecture01 object oriented-programming
Lecture01 object oriented-programmingLecture01 object oriented-programming
Lecture01 object oriented-programming
 
OOPS Characteristics
OOPS CharacteristicsOOPS Characteristics
OOPS Characteristics
 
Object oriented concepts
Object oriented conceptsObject oriented concepts
Object oriented concepts
 
Basic concept of OOP's
Basic concept of OOP'sBasic concept of OOP's
Basic concept of OOP's
 
Chapter1 - Introduction to Object-Oriented Programming and Software Development
Chapter1 - Introduction to Object-Oriented Programming and Software DevelopmentChapter1 - Introduction to Object-Oriented Programming and Software Development
Chapter1 - Introduction to Object-Oriented Programming and Software Development
 
Introduction to Object Oriented Programming
Introduction to Object Oriented ProgrammingIntroduction to Object Oriented Programming
Introduction to Object Oriented Programming
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft Developer
 
General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
 

Viewers also liked

Meta-Classes in Python
Meta-Classes in PythonMeta-Classes in Python
Meta-Classes in PythonGuy Wiener
 
EuroPython 2015 - Decorators demystified
EuroPython 2015 - Decorators demystifiedEuroPython 2015 - Decorators demystified
EuroPython 2015 - Decorators demystifiedPablo Enfedaque
 
The (unknown) collections module
The (unknown) collections moduleThe (unknown) collections module
The (unknown) collections modulePablo Enfedaque
 
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)Bart Feenstra
 
Message-passing concurrency in Python
Message-passing concurrency in PythonMessage-passing concurrency in Python
Message-passing concurrency in PythonSarah Mount
 
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.Samuel Fortier-Galarneau
 
Python decorators
Python decoratorsPython decorators
Python decoratorsAlex Su
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummaryAmal Khailtash
 
Multiprocessing with python
Multiprocessing with pythonMultiprocessing with python
Multiprocessing with pythonPatrick Vergain
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 prsamurti
 
Prepping the Analytics organization for Artificial Intelligence evolution
Prepping the Analytics organization for Artificial Intelligence evolutionPrepping the Analytics organization for Artificial Intelligence evolution
Prepping the Analytics organization for Artificial Intelligence evolutionRamkumar Ravichandran
 
QCon Rio - Machine Learning for Everyone
QCon Rio - Machine Learning for EveryoneQCon Rio - Machine Learning for Everyone
QCon Rio - Machine Learning for EveryoneDhiana Deva
 
Python for Image Understanding: Deep Learning with Convolutional Neural Nets
Python for Image Understanding: Deep Learning with Convolutional Neural NetsPython for Image Understanding: Deep Learning with Convolutional Neural Nets
Python for Image Understanding: Deep Learning with Convolutional Neural NetsRoelof Pieters
 
Tutorial on Deep learning and Applications
Tutorial on Deep learning and ApplicationsTutorial on Deep learning and Applications
Tutorial on Deep learning and ApplicationsNhatHai Phan
 

Viewers also liked (20)

Meta-Classes in Python
Meta-Classes in PythonMeta-Classes in Python
Meta-Classes in Python
 
Oop objects_classes
Oop objects_classesOop objects_classes
Oop objects_classes
 
EuroPython 2015 - Decorators demystified
EuroPython 2015 - Decorators demystifiedEuroPython 2015 - Decorators demystified
EuroPython 2015 - Decorators demystified
 
The (unknown) collections module
The (unknown) collections moduleThe (unknown) collections module
The (unknown) collections module
 
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
An Introduction to Object-Oriented Programming (DrupalCamp North 2015)
 
Message-passing concurrency in Python
Message-passing concurrency in PythonMessage-passing concurrency in Python
Message-passing concurrency in Python
 
Python decorators
Python decoratorsPython decorators
Python decorators
 
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
Decorators Explained: A Powerful Tool That Should Be in Your Python Toolbelt.
 
Python decorators
Python decoratorsPython decorators
Python decorators
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
Multiprocessing with python
Multiprocessing with pythonMultiprocessing with python
Multiprocessing with python
 
Interfacing C/C++ and Python with SWIG
Interfacing C/C++ and Python with SWIGInterfacing C/C++ and Python with SWIG
Interfacing C/C++ and Python with SWIG
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 p
 
Python in Action (Part 1)
Python in Action (Part 1)Python in Action (Part 1)
Python in Action (Part 1)
 
Prepping the Analytics organization for Artificial Intelligence evolution
Prepping the Analytics organization for Artificial Intelligence evolutionPrepping the Analytics organization for Artificial Intelligence evolution
Prepping the Analytics organization for Artificial Intelligence evolution
 
Mastering Python 3 I/O (Version 2)
Mastering Python 3 I/O (Version 2)Mastering Python 3 I/O (Version 2)
Mastering Python 3 I/O (Version 2)
 
An Introduction to Python Concurrency
An Introduction to Python ConcurrencyAn Introduction to Python Concurrency
An Introduction to Python Concurrency
 
QCon Rio - Machine Learning for Everyone
QCon Rio - Machine Learning for EveryoneQCon Rio - Machine Learning for Everyone
QCon Rio - Machine Learning for Everyone
 
Python for Image Understanding: Deep Learning with Convolutional Neural Nets
Python for Image Understanding: Deep Learning with Convolutional Neural NetsPython for Image Understanding: Deep Learning with Convolutional Neural Nets
Python for Image Understanding: Deep Learning with Convolutional Neural Nets
 
Tutorial on Deep learning and Applications
Tutorial on Deep learning and ApplicationsTutorial on Deep learning and Applications
Tutorial on Deep learning and Applications
 

Similar to Object Oriented Programming Concepts

Similar to Object Oriented Programming Concepts (20)

1 intro
1 intro1 intro
1 intro
 
Ooad notes
Ooad notesOoad notes
Ooad notes
 
Java pdf
Java   pdfJava   pdf
Java pdf
 
Oops slide
Oops slide Oops slide
Oops slide
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 
M.c.a. (sem iv)- java programming
M.c.a. (sem   iv)- java programmingM.c.a. (sem   iv)- java programming
M.c.a. (sem iv)- java programming
 
Oops
OopsOops
Oops
 
Chapter 04 object oriented programming
Chapter 04 object oriented programmingChapter 04 object oriented programming
Chapter 04 object oriented programming
 
MCA NOTES.pdf
MCA NOTES.pdfMCA NOTES.pdf
MCA NOTES.pdf
 
Object And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) LanguagesObject And Oriented Programing ( Oop ) Languages
Object And Oriented Programing ( Oop ) Languages
 
JAVA PROGRAMMING
JAVA PROGRAMMING JAVA PROGRAMMING
JAVA PROGRAMMING
 
Birasa 1
Birasa 1Birasa 1
Birasa 1
 
C++
C++C++
C++
 
Oops concepts
Oops conceptsOops concepts
Oops concepts
 
香港六合彩 » SlideShare
香港六合彩 » SlideShare香港六合彩 » SlideShare
香港六合彩 » SlideShare
 
SEMINAR
SEMINARSEMINAR
SEMINAR
 
Seminar
SeminarSeminar
Seminar
 
JAVA PROGRAMMINGD
JAVA PROGRAMMINGDJAVA PROGRAMMINGD
JAVA PROGRAMMINGD
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptxOBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
 

Recently uploaded

Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 

Recently uploaded (20)

Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 

Object Oriented Programming Concepts

  • 1. Development Software 2 (DOS200S) 2013 OBJECT ORIENTED PROGRAMMING CONCEPTS Compiled By WH Olivier 2013/01/291
  • 2. Introduction Classes & Objects 2013/01/29Compiled By WH Olivier2 In the real world, an object can be anything that we can see around us. An object can be of a certain type. A dog, for instance is a type of animal. Animals is characterized by the way they look and the way they behave. A dog belong to the animal class and therefore inherits the properties and behavior of an animal. A Dalmatian again, is a type of dog and would inherit the properties and the behavior of a dog. Therefore, we can differentiate between a class and an object. A Class is a blueprint or template for an object. A class specifies or defines an objects properties and behavior. An Object is an instance of a class or type. Two dogs would possess different values for their color and size properties.
  • 3. Classes & Objects cont… 2013/01/29Compiled By WH Olivier3
  • 4. A Car Class 2013/01/29Compiled By WH Olivier4  The creation of a car typically begins as engineering drawings. The drawings would include all the features, components and properties of the car. Included in the design would be all the mechanisms that will allow the car to perform some function.  For example, in order for a car to accelerate, pressing the pedal would perform that function.  Unfortunately you cannot drive the drawings. Building a car from that engineering drawings would be creating an instance a car. The car instance (object) would possess all the features and properties of that car class.  Once the car is there you can drive it, press the accelerator pedal and that would course the car to move faster Read more… Introduction to classes and objects
  • 5. Objects in Business 2013/01/29Compiled By WH Olivier5  In the business world, companies deal with various types of data. Data elements can be grouped because they are related. For example all the data about a customer are grouped and can be represented as a Customer object.  Other objects would be Employee, Order, Invoice, etc.  Read More on Business Objects  Business Objects  Introduction to SAP Business Objects
  • 6.  Program design use to be (and still is being used) procedural. Procedural programming is creating a step by step program where the program is a sequence of instructions . Execution of the program starts at the top and continues executing code line by line till the bottom.  Procedural programming also include functions (smaller programmes) where the program can change data which it has access to via the functions.  With procedural programming the data and the operations on the data is separate and data is being passed and changed via the functions. Compiled By WH Olivier 2013/01/296
  • 7.  In Object Oriented Programming, things are being viewed as entities called objects. Objects is the grouping of data and its related functionality into one unit.  OOP is a design philosophy used in different programming languages. Everything within OOP is grouped as a self sustainable object. OOP thus have a re-usable component where objects can be used in many other programs.  An Object is entity or thing that can perform a set of related activities / behavior (Eg. A CAR can drive, brake) and have particular characteristics / properties ( Eg. A Car have color, engine capacity)  A Class is simply a representation of a type of object. It is a blueprint for the describing the detail of an object. Compiled By WH Olivier 2013/01/297
  • 8.  The encapsulation is the inclusion within a program object of all the resources need for the object to function - basically, the methods and the data.  In OOP the encapsulation is mainly achieved by creating classes, the classes expose public methods and properties.  The class is kind of a container or capsule or a cell, which encapsulate the set of methods, attribute and properties to provide its indented functionalities to other classes. In that sense, encapsulation also allows a class to change its internal implementation without hurting the overall functioning of the system. Compiled By WH Olivier 2013/01/298
  • 9.  Abstract classes, which declared with the abstract keyword, cannot be instantiated. It can only be used as a super-class for other classes that extend the abstract class. Abstract class is the concept and implementation gets completed when it is being realized by a subclass. In addition to this a class can inherit only from one abstract class (but a class may implement many interfaces) and must override all its abstract methods/ properties and may override virtual methods/ properties. Compiled By WH Olivier 2013/01/299
  • 10.  Abstract data types can be implemented via classes and object.  When defining a new class and creating a object based on that class, you created an abstract data type.  Abstract data types are purely theoretical entities, used (among other things) to simplify the description of abstract algorithms, to classify and evaluate data structures, and to formally describe the type systems of programming languages.* * http://en.wikipedia.org/wiki/Abstract_data_typeCompiled By WH Olivier 2013/01/2910
  • 11. Inheritance & Composition  The ability for a new class to be created from an existing class by extending it is known as inheritance.  When one class contains another class as one of its members, that is known as composition  The following slide explains it by use of a diagram Compiled By WH Olivier 2013/01/2911
  • 12. dataType -dMonth: int -dDay: int -dYear: int +setDate(int, int, int) : void +getDay() const: int +getMonth() const: int +getYear() const: int +printDate() const: void +dateType(int = 1, int = 1, int =1900) partTimeEmployee Class +print() const : void +calculatePay() const: double +setNameRateHours(string, string, double, double) : void +partTimeEmployee(string = “ “, string = “ “, double = 0, double = 0)-payRate : double -hoursWorked : double personType Class +print() const : void +setName(string, string: void +getFirtsName() const: string +getLastName() const : string +personType(string = “ “, string = “ “) -firstname : string -lastname : string personalInfo Class +setPersonalInfo(string, string, int, int, int, int) : void +printPersonalInfo() const : void +personalInfoType(string = “ “, string = “ “, int = 1, int =1, int = 1900, int = 0) -name : personType -bDay : dateType -personID: int INHERITANCE partTimeEmployee “is a” type of personType COMPOSITION personalInfo “has a” dateType as one of its members COMPOSITION personalInfo “has a” personType as one of its members INHERITANCE and COMPOSITION Compiled By WH Olivier 2013/01/2912
  • 13.  What is Polymorphism:  Is a generic term which means ‘many shapes’  Is also means the ability to that one operation be performed by a wide range of different things. Simply stated, a operation will perform differently depending on the way it is called and by which other thing it is being requested.  Method Overloading, Operator Overloading and Method Overriding is the different techniques used to achieve polymorphism  What is Method Overloading  The ability to define several methods with the same name  What is Operator Overloading  Operators like +, -, *, == are treated as polymorphic functions and as such have different behaviours depending on the way it is called (arguments)  What is Method Overriding  Is used in inheritance where a sub-class can override a specific implementation of a method that is already provided by the super- class Compiled By WH Olivier 2013/01/2913
  • 14. Reference  http://saimaterial.wordpress.com/2007/09/14/1what- is-the-difference-between-object-oriented- programming-and-procedural-programming/  http://www.codeproject.com/Articles/22769/Introductio n-to-Object-Oriented-Programming-Concep  http://math.hws.edu/eck/cs124/downloads/OOP2_fro m_Univ_KwaZulu-Natal.pdf  http://www.deitel.com/books/cpphtp5/cpphtp5_03_sa mple.pdf  http://publib.boulder.ibm.com/infocenter/dmndhelp/v7r 5m1/index.jsp?topic=%2Fcom.ibm.wbpm.wid.data.do c%2Fbo%2Ftopics%2Fcbo.html  http://help.sap.com/saphelp_40b/helpdata/en/7e/5e11 a84a1611d1894c0000e829fbbd/content.htm Compiled By WH Olivier 2013/01/2914
  • 15. Double click below to open 2013/01/29Compiled By WH Olivier15
  • 16. Double click below to open 2013/01/29Compiled By WH Olivier16
  • 17. Double click below to open 2013/01/29Compiled By WH Olivier17