PHP OOP
OOP PHP is short for Object Oriented Programming PHP. PHP, supports structured programming you have learned in the basic tutorial of PHP, also supports Object Oriented Programming or also known as OOP. Although support for OOP in PHP is not as powerful as Java, but PHP is mature enough to support OOP. You can get a lot of classes that you need on the internet to make your program.
Previously I need to say, that making this OOP-based program will be felt the benefits if you make large-scale program or programs that would often you repeat the making with a few minor adjustments, but for small-scale programs, may be better to use a structured programming.
Object Oriented Programming is a way to make object-based program, meaning that you must change the way you think the object-based. But before we go any further more, you will be my first introduction with some new terms that will be most used in OOP is class, object, encapsulation, inheritance and polymorphism.
Actual ability of a programming language in support of OOP is determined by their ability to support the five terms I have mentioned in previous paragraphs it. It may also, or will you ever wondered what the difference OOP functionality is. Well we shall see the difference.
Encapsulation
As I promised in the last tutorial PHP Class, from now on I will be a story about the encapsulation or encapsulation.
Never take medicine capsule form? Encapsulation function is also similar to the capsule, which is wrapped around or hiding drugs in them.
In OOP is certainly not a drug that is hidden but its code.
Ok, we return to our home illustrative example. I am convinced that if we ask about the materials of brick makers, masons were at least know that not all land can be used as a brick. She will likely respond with clay or red earth as a material for bricks.
wrapping or concealment of information that is roughly the meaning of encapsulation or encapsulation. In programming, the purpose of encapsulation is to hide properties and methods of an object. Not all property or method that is hidden, some of them were informed.
Property or method shown earlier in the case of our bricks is clay or soil is red.
Well, property or method that is displayed in the object called the interface.
Encapsulation has several advantages:
Modularity. This makes the object can be managed independently. Bricks, cement and wood could be made separately by each expert, but in the end can be mutually united to form a house.
Hidden Information. This will facilitate the user's class, because for each object would have provided an interface that will be used to communicate with other objects, without needing to know the details of the code or the information hidden in it.
Ok. An explanation of the encapsulation I end here. Next we will discuss about the Inheritance.


Twitter
Youtube
Digg
Delicious
StumbleUpon
Facebook