• 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
    • My Tools
    • Bootstrap Navbar Online Generator
    • Bootstrap Demo
    • Amazon Asin Grabber
    • Azoncast v2 Theme
  • ADVERTISE
  • CATEGORIES
    • Android
    • Blogging Tips
    • Database
    • CSS
    • Info Gadget
    • Javascript
    • Linux
    • PHP
    • Various
    • WordPress
  • PHP
  • JAVASCRIPT
  • JQUERY
  • ANGULAR
  • WORDPRESS
  • SEO
🏠 » 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

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

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

Do you want to get Free WordPress Videos, Plugins, and Other Useful Resources ?

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

we respect your privacy and take protecting it seriously

Popular Articles

How To Replace String With Another String In PHP

September 16, 2019 By Sigit Prasetya Nugroho Leave a Comment

Increase Traffic with the Right Yoast Settings

October 16, 2014 By Sigit Prasetya Nugroho Leave a Comment

Boost Social Media Traffic with OnePress Social Locker

October 17, 2014 By Sigit Prasetya Nugroho Leave a Comment

Amazon Custom Thumbnail Plugin New Version Launch

September 18, 2014 By Sigit Prasetya Nugroho Leave a Comment

Web Applications as Desktop Flavor with Ajax Agent

October 11, 2014 By Sigit Prasetya Nugroho Leave a Comment

Tags

adminlte adsense adsense tips affiliate amazon ajax amazon Android angular angular 4 angular 5 asin grabber Bootstrap codeigniter create wordpress theme crud css free wordpress theme google adsense imacros increase traffic jquery laravel laravel 5 learn android modal dialog mysql nodeJs optimize seo pdo php plugin pos Publisher Tips SEO theme tutorial tutorial angular tutorial angular 4 tutorial javascript tutorial javascript beginners twitter widget wordpress wordpress plugin XMLRPC




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

©2019 Seegatesite.com