Showing posts with label OOP. Show all posts
Showing posts with label OOP. Show all posts

4/19/12

Object-Oriented Programming meets PHP with examples

After getting request for the above topic, we decided to write a tutorial on it. However, if you need more detailed lessons you can check out www.computerclasses.org for available courses on this topic.

As we all know that object-oriented programming is an approach in which objects and classes are used and this approach is being followed by the some of the leading programming language like C++ and Java. Click here, to read about OOPs Concept in Java.

Before the introduction of PHP 4 OOP in PHP was not at all possible but after its introduction in PHP 4 and more advancement in PHP 5, the users are making full use of it and other programmer who thought PHP to be difficult are now actually enjoying it.



10/31/11

OOPs Concept : Polymorphism

Polymorphism is the ability of an object to take on many forms. The most common use of polymorphism in OOP occurs when a parent class reference is used to refer to a child class object.


Any java object that can pass more than on IS-A test is considered to be polymorphic. In Java, all java objects are polymorphic since any object will pass the IS-A test for their own type and for the class Object.


It is important to know that the only possible way to access an object is through a reference variable. A reference variable can be of only one type. Once declared the type of a reference variable cannot be changed.


10/23/11

OOPs Concept : Inheritance

After discussing Encapsulation, now its time for 'Inheritance' as OOP Concept.


Inheritance can be defined as the process where one object acquires the properties of another. With the use of inheritance the information is made manageable in a hierarchical order.


When we talk about inheritance the most commonly used keyword would be extends and implements. These words would determine whether one object IS-A type of another. By using these keywords we can make one object acquire the properties of another object.


10/9/11

Object Oriented Programming (OOP) Explanation

Object-oriented programming (OOP) is a programming paradigm that uses "objects" to design applications and computer programs. It utilizes several techniques from previously established paradigms, including inheritance, modularity, polymorphism, and encapsulation. Today, many popular programming languages (such as Ada, C++, Delphi, Java, Lisp, SmallTalk, Perl, PHP, Python, Ruby, VB.Net, Visual FoxPro, and Visual Prolog) support OOP. 


9/12/11

OOPs Concept: Encapsulation

Encapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction. RFAZHE7YNFV8

Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods. If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class. For this reason, encapsulation is also referred to as data hiding.