Encapsulation

 

Encapsulation php 300x234 Encapsulation

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.

Incoming search terms:

  • encapsulation
  • encapsulation in class diagram
share save 171 16 Encapsulation
This entry was posted in Programming and tagged Encapsulation. Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>