SlideShare a Scribd company logo
Object-Oriented Programming
(OOP)
MD. ATIKUR RAHMAN
PHP
Lecture - 01
Programmer, Silkcity Solution
Trainer, CBA IT
2
Agenda
o Object-Oriented Programming (OOP)
o Procedural programming
o Procedural programming vs OOP
o Features/Principles of OOP
o Advantages of using OOP
o Class
o Object
o Class vs Object
o Object Characteristics
Object-Oriented
Programming (OOP)
OOP is a programming paradigm based on the concept of "objects", which can
contain data and code. data in the form of fields, and code, in the form of
procedures.
A common feature of objects is that procedures are attached to them and can
access and modify the object's data fields
Note : The "Don't Repeat Yourself" (DRY) principle is about reducing the
repetition of code.
4
Procedural programming is a programming paradigm
built around the idea that programs are sequences of
instructions to be executed.
Procedural
programming
PP vs 00P
Procedural programming Object-Oriented Programming
Divided into small parts called functions. Divided into small parts called objects.
follows a top-down approach. follows a bottom-up approach.
No access specifier
Has access specifiers like private, public, protected,
etc.
Does not have any proper way of hiding data so it
is less secure.
Provides data hiding so it is more secure.
overloading is not possible. Overloading is possible
there is no concept of data hiding and inheritance. the concept of data hiding and inheritance is used.
5
PP vs 00P
Procedural programming Object-Oriented Programming
the function is more important than the data. data is more important than function.
based on the unreal world. based on the real world.
Used for designing medium-sized programs.
Used for designing large and complex
programs.
uses the concept of procedure abstraction. uses the concept of data abstraction.
Code reusability absent Code reusability present
Examples: C, FORTRAN, Pascal, Basic, etc. Exemples: C++, Java, Python, C#,PHP etc.
6
The main
Features/Principles
of OOP
Data
Abstraction
7
Inheritance Encapsulation
Polymorphism
Advantages of
using OOP
o OOPs is very helpful in solving very complex level of problems.
o Highly complex programs can be created, handled, and maintained easily
using object-oriented programming.
o OOPs, promote code reuse, thereby reducing redundancy.
o OOPs also helps to hide the unnecessary details with the help of Data
Abstraction.
o OOPs, are based on a bottom-up approach, unlike the Structural
programming paradigm, which uses a top-down approach.
o Polymorphism offers a lot of flexibility in OOPs.
 Class
 Object
 Properties
 Methods (or Functions)
9
Understand the
following terms
Class
A class is a blueprint. It is a piece of code describing how to
manage a topic or task in the way we want.
• It is a user-defined data type
• Inside a class, we define variables, constants, member functions, and other
functionality.
• it binds data and functions together in a single unit.
• It does not consume memory at run time.
Structuring Classes
declare a class using the class
keyword
followed by the name of the class and
a set of curly braces { }
<?php
class MyClass
{
// Class properties and methods
}
?>
Object
An object is a real-world entity that has attributes, behavior, and
properties. It is referred to as an instance of the class. It contains
member functions, variables that we have defined in the class. It
occupies space in the memory.
Different objects have different states or attributes, and behaviors.
Structuring Object
We created the object $myObject from
the class MyClass with the new keyword.
The process of creating an object is also
known as instantiation.
<?php
class MyClass
{
// Class properties and methods
}
$myObject = new MyClass();
?>
class vs object
class object
It is a logical entity. It is a real-world entity.
It is conceptual. It is real.
It binds data and methods together into a single unit. It is just like a variable of a class.
It does not occupy space in the memory. It occupies space in the memory.
It is a data type that represents the blueprint of an
object.
It is an instance of the class.
It is declared once. Multiple objects can be declared.
It uses the keyword class when declared. It uses the new keyword to create an object.
A class can exist without any object. Objects cannot exist without a class.
12
13
Object
Characteristics
objects share the two common key characteristics
o State
o Behavior
State tells us how the object looks or what properties
it has.
Behavior tells us what the object does.
Object holds its state in variables that are often referred to as
properties.
Object also exposes its behavior via functions or methods.
14
Object
Characteristics
example
A bank account has the state that
consists of
Account
Number
Balance Deposit Withdraw
A bank account also has the following
behaviors
Thank you

More Related Content

PDF
Java Design Patterns Tutorial | Edureka
PDF
Introduction to Node JS.pdf
PPT
Introduction to Javascript
PDF
Industrail training report on website design and development
PPT
Java Crypto
PPT
Top java script frameworks ppt
PDF
Angular
Java Design Patterns Tutorial | Edureka
Introduction to Node JS.pdf
Introduction to Javascript
Industrail training report on website design and development
Java Crypto
Top java script frameworks ppt
Angular

What's hot (20)

PDF
Software engineering for IV sem BCA ,RCU Belgavi.Syllabus
PPTX
Php oop presentation
PDF
Javascript essentials
PDF
Making The Move To Java 17 (JConf 2022)
PPTX
Angular js PPT
PPT
PDF
Enterprise Java Beans - EJB
PPT
PHP - Introduction to File Handling with PHP
PDF
Object Oriented Design Principles
PPSX
Javascript variables and datatypes
PDF
Intro to Dynamic Web Pages
PPTX
Angularjs PPT
PDF
React - Introdução
PPTX
ATM Banking
PPTX
Introduction to Angularjs
PPTX
Introduction to AngularJS
PDF
JavaScript - Chapter 15 - Debugging Techniques
Software engineering for IV sem BCA ,RCU Belgavi.Syllabus
Php oop presentation
Javascript essentials
Making The Move To Java 17 (JConf 2022)
Angular js PPT
Enterprise Java Beans - EJB
PHP - Introduction to File Handling with PHP
Object Oriented Design Principles
Javascript variables and datatypes
Intro to Dynamic Web Pages
Angularjs PPT
React - Introdução
ATM Banking
Introduction to Angularjs
Introduction to AngularJS
JavaScript - Chapter 15 - Debugging Techniques
Ad

Similar to PHP OOP Lecture - 01.pptx (20)

PPTX
Principles of OOPs.pptx
DOCX
Object Oriented Programming All Unit Notes
PPT
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
PPTX
Object oriented programming in python
PPTX
Intro to object oriented programming.pptx
PDF
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
PPTX
CPP-Unit 1.pptx
PPTX
JAVA - Oops Concept.pptx
PPT
Share Unit 1- Basic concept of object-oriented-programming.ppt
PDF
Oops concepts
PDF
lecture.in ooop object orented programmeg.pdf
PPT
Unit 1- Basic concept of object-oriented-programming.ppt
PPTX
basics of c++ object oriented programming l anguage
PPTX
introduction to object oriented programming
PPTX
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
PPTX
Class and Objects in python programming.pptx
PPTX
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
PDF
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
PPTX
Python-Classes.pptx
PPT
Basic concept of OOP's
Principles of OOPs.pptx
Object Oriented Programming All Unit Notes
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
Object oriented programming in python
Intro to object oriented programming.pptx
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
CPP-Unit 1.pptx
JAVA - Oops Concept.pptx
Share Unit 1- Basic concept of object-oriented-programming.ppt
Oops concepts
lecture.in ooop object orented programmeg.pdf
Unit 1- Basic concept of object-oriented-programming.ppt
basics of c++ object oriented programming l anguage
introduction to object oriented programming
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
Class and Objects in python programming.pptx
OOSD Lecture 1-1.pptx FOR ENGINEERING STUDENTS
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
Python-Classes.pptx
Basic concept of OOP's
Ad

Recently uploaded (20)

PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Cell Types and Its function , kingdom of life
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Cell Structure & Organelles in detailed.
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Complications of Minimal Access Surgery at WLH
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
O7-L3 Supply Chain Operations - ICLT Program
O5-L3 Freight Transport Ops (International) V1.pdf
Basic Mud Logging Guide for educational purpose
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPH.pptx obstetrics and gynecology in nursing
human mycosis Human fungal infections are called human mycosis..pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Cell Types and Its function , kingdom of life
STATICS OF THE RIGID BODIES Hibbelers.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Renaissance Architecture: A Journey from Faith to Humanism
Cell Structure & Organelles in detailed.
102 student loan defaulters named and shamed – Is someone you know on the list?
Abdominal Access Techniques with Prof. Dr. R K Mishra
Complications of Minimal Access Surgery at WLH
2.FourierTransform-ShortQuestionswithAnswers.pdf

PHP OOP Lecture - 01.pptx

  • 1. Object-Oriented Programming (OOP) MD. ATIKUR RAHMAN PHP Lecture - 01 Programmer, Silkcity Solution Trainer, CBA IT
  • 2. 2 Agenda o Object-Oriented Programming (OOP) o Procedural programming o Procedural programming vs OOP o Features/Principles of OOP o Advantages of using OOP o Class o Object o Class vs Object o Object Characteristics
  • 3. Object-Oriented Programming (OOP) OOP is a programming paradigm based on the concept of "objects", which can contain data and code. data in the form of fields, and code, in the form of procedures. A common feature of objects is that procedures are attached to them and can access and modify the object's data fields Note : The "Don't Repeat Yourself" (DRY) principle is about reducing the repetition of code.
  • 4. 4 Procedural programming is a programming paradigm built around the idea that programs are sequences of instructions to be executed. Procedural programming
  • 5. PP vs 00P Procedural programming Object-Oriented Programming Divided into small parts called functions. Divided into small parts called objects. follows a top-down approach. follows a bottom-up approach. No access specifier Has access specifiers like private, public, protected, etc. Does not have any proper way of hiding data so it is less secure. Provides data hiding so it is more secure. overloading is not possible. Overloading is possible there is no concept of data hiding and inheritance. the concept of data hiding and inheritance is used. 5
  • 6. PP vs 00P Procedural programming Object-Oriented Programming the function is more important than the data. data is more important than function. based on the unreal world. based on the real world. Used for designing medium-sized programs. Used for designing large and complex programs. uses the concept of procedure abstraction. uses the concept of data abstraction. Code reusability absent Code reusability present Examples: C, FORTRAN, Pascal, Basic, etc. Exemples: C++, Java, Python, C#,PHP etc. 6
  • 8. Advantages of using OOP o OOPs is very helpful in solving very complex level of problems. o Highly complex programs can be created, handled, and maintained easily using object-oriented programming. o OOPs, promote code reuse, thereby reducing redundancy. o OOPs also helps to hide the unnecessary details with the help of Data Abstraction. o OOPs, are based on a bottom-up approach, unlike the Structural programming paradigm, which uses a top-down approach. o Polymorphism offers a lot of flexibility in OOPs.
  • 9.  Class  Object  Properties  Methods (or Functions) 9 Understand the following terms
  • 10. Class A class is a blueprint. It is a piece of code describing how to manage a topic or task in the way we want. • It is a user-defined data type • Inside a class, we define variables, constants, member functions, and other functionality. • it binds data and functions together in a single unit. • It does not consume memory at run time. Structuring Classes declare a class using the class keyword followed by the name of the class and a set of curly braces { } <?php class MyClass { // Class properties and methods } ?>
  • 11. Object An object is a real-world entity that has attributes, behavior, and properties. It is referred to as an instance of the class. It contains member functions, variables that we have defined in the class. It occupies space in the memory. Different objects have different states or attributes, and behaviors. Structuring Object We created the object $myObject from the class MyClass with the new keyword. The process of creating an object is also known as instantiation. <?php class MyClass { // Class properties and methods } $myObject = new MyClass(); ?>
  • 12. class vs object class object It is a logical entity. It is a real-world entity. It is conceptual. It is real. It binds data and methods together into a single unit. It is just like a variable of a class. It does not occupy space in the memory. It occupies space in the memory. It is a data type that represents the blueprint of an object. It is an instance of the class. It is declared once. Multiple objects can be declared. It uses the keyword class when declared. It uses the new keyword to create an object. A class can exist without any object. Objects cannot exist without a class. 12
  • 13. 13 Object Characteristics objects share the two common key characteristics o State o Behavior State tells us how the object looks or what properties it has. Behavior tells us what the object does. Object holds its state in variables that are often referred to as properties. Object also exposes its behavior via functions or methods.
  • 14. 14 Object Characteristics example A bank account has the state that consists of Account Number Balance Deposit Withdraw A bank account also has the following behaviors