• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
seegatesite header

Seegatesite.com

Seegatesite.com - Programming Tutorial , Sharing , How and Learn Together

  • TOOLS
    • Bootstrap Navbar Online Generator
    • Customize Sidebar Menu Bootstrap 3
    • Bootstrap Demo
  • ADVERTISE
  • CATEGORIES
    • Android
    • Blogging Tips
    • Database
    • CSS
    • Info Gadget
    • Javascript
    • Linux
    • PHP
    • Various
    • WordPress
  • Q&A
  • PHP
  • JAVASCRIPT
  • JQUERY
  • ANGULAR
  • WORDPRESS
  • SEO
  • REACT
🏠 » PHP » Concept Object Oriented Programming PHP for beginners

Concept Object Oriented Programming PHP for beginners

By Sigit Prasetya Nugroho ∙ January 11, 2015 ∙ PHP ∙ Leave a Comment

Share : TwitterFacebookTelegramWhatsapp

This article I will discuss the basic object oriented programming in PHP, including encapsulation and inheritance and polymorphism. Encapsulation is the concept to hide information from the user which consists of methods and properties. While inheritance is the concept of the use of data members and methods on the default class. Besides discussing complementary components in object-oriented programming.

Concept Object Oriented Programming PHP for beginners

Table of Contents

  • 1  The basic concepts of object oriented programming in PHP 
    • 1.1 2. Object Oriented Programming in PHP

 The basic concepts of object oriented programming in PHP 

1. Object

Before going any further, we need to understand about the definition of the object. In principle, the object is an element that can be understood. If the real viewpoint, the object is something that has a shape and mass, but if we are talking concept, object is an idea / ideas.

Examples of the object is a person, animal, car, idea. In conclusion every object has something that can be distinguished from one object to another object, where each object in general have remained condition / state and operation / method. Or, simply, object identifier / properties / attributes and functions.

For example, a car has identifier or attribute that is, have the tire, wheel, doors, engine, etc. Functions / its behavior is can be a condition of the car which can be accelerated or slowed down, can sound the horn, can turn on the lights. From this concept then developed a new programming technique that is based on the real world / real object

2. Object Oriented Programming in PHP

From the description above can be concluded that the simple, object-oriented programming means a programming technique in the development process using the terminology of objects, where each object has attributes and functions that can interact with each other as well as objects.

The characteristics that is the basic idea of how to develop a complex software using the object model. Thus the software development process will be easier because it will adjust to the object programming model with which we will create

Additionally PBO has a goal to provide insight to the user or client systems. This is because the user / client can more easily understand the flow of programming faced.

3. Main pillar Object-oriented Programming in PHP

I think the PBO has three main pillars

a. Encapsulation

Encapsulation is a technique used to perform concealment of information that is not required by the user. Hidden data in the form of attributes and functions that are interconnected to form a set of data structures. By using this method of how a programmer who uses a new data type from other developers do not need to understand how the data type is created, but quite understand about the interface of the class

b. Inheritance

Inheritance presented modeling derived from the real world, where each new data types can be derived from the data type of the parent or superclass so that the derived class will inherit all the properties of its parent. But it is worth noting that the derivative is not just easy to access data and functions of the parent class, but the concept of the object itself. If the “cat” is a derivative of “mammals”, it means “cat” not only has all the data and functions of the “mammal”, but “cat” itself is a “mammal”

c. Polymorphism

Model or form that can be used on a variety of objects. Different objects derived from the same parent and can have the same function with different implementation. For example, we have a parent class that has the function of a “show”, then lowered to 2 different other classes. At the time of the first component is displayed with the function of the “show”, it will be routine work of the first component as well as the second component. So even though both are met by the same parent component to perform the same function, but in practice, the function of the “show” will perform a routine in accordance with the respective derivative components.

Discussion on the concept and implementation of object oriented programming in PHP, i will present in my next article

Another PHP Related Post :

  • Tutorial Create Simple POS Using ReactJS And Laravel Lumen Part 1
  • How To Replace String With Another String In PHP
  • Login Page – Tutorial CRUD Client and API Server Using JQuery And Lumen Part 2
  • Tutorial CRUD Client and API Server Using JQuery And Lumen Part 1
  • How To Solve Problems Illegal mix of collations (latin1_swedish_ci,IMPLICIT) In Laravel
  • How To Resolve No ‘Access-Control-Allow-Origin’ Header In Lumen

Avatar for Sigit Prasetya Nugroho

About Sigit Prasetya Nugroho

This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Welcome to my Home,

Avatar for Sigit Prasetya NugrohoThis site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.



Popular Articles

Checked checkbox AdminLTE Bootstrap in Jquery

November 4, 2014 By Sigit Prasetya Nugroho 7 Comments

Simple create date format validation with jqueryUI

December 21, 2014 By Sigit Prasetya Nugroho Leave a Comment

Create Simple Progress Bar for Fake Online Generator with Jquery

January 10, 2015 By Sigit Prasetya Nugroho Leave a Comment

22+ Coolest Free Jquery Plugin For Premium Theme

October 3, 2015 By Sigit Prasetya Nugroho Leave a Comment

Easy Build Your Anti Copy Paste Plugin

October 6, 2015 By Sigit Prasetya Nugroho Leave a Comment

Popular Tags

adminlte (15) adsense (13) adsense tips (4) affiliate amazon (13) amazon (12) Android (8) angular (16) angular 4 (12) angular 5 (4) asin grabber (3) Bootstrap (27) codeigniter (5) create wordpress theme (5) crud (8) css (6) free wordpress theme (7) google adsense (4) imacros (4) increase traffic (6) jquery (34) laravel (10) laravel 5 (5) learn android (5) lumen api (4) modal dialog (5) mysql (6) nodeJs (4) optimize seo (4) pdo (6) php (30) plugin (53) pos (8) Publisher Tips (5) react (6) Reactjs (9) SEO (37) theme (17) tutorial angular (5) tutorial angular 4 (6) tutorial javascript (10) tutorial javascript beginners (4) twitter (3) wordpress (18) wordpress plugin (13) XMLRPC (5)




  • About
  • Contact Us
  • Disclaimer
  • Privacy Policy
  • Terms and Conditions

©2022 Seegatesite.com