Web Hosting Forum | Lunarpages

Author Topic: Encapsulation?  (Read 5641 times)

Offline android45

  • Spaceship Captain
  • *****
  • Posts: 110
Encapsulation?
« on: October 30, 2012, 12:49:27 AM »
What is encapsulation? please explain. Thanks in advance.

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6231
Re: Encapsulation?
« Reply #1 on: October 30, 2012, 05:49:48 AM »
In simplest terms, to encapsulate data is to isolate and cordon it off so that it can only be worked with via defined methods (as in a class). The idea is to not allow random access to the data, but only through the well-defined methods. This prevents damage to the system in case a programmer doesn't quite understand the proper usage of the (raw) data, and permits the implementation to be changed behind the scenes without affecting how the programmer uses it (through methods).
Visit My Site

E-mail Me
  
-= From the ashes shall rise a sooty tern =-

Offline noahwilson

  • Spacescooter Operator
  • *****
  • Posts: 48
Re: Encapsulation?
« Reply #2 on: May 28, 2013, 11:31:21 PM »
Nice topic, thanks for sharing this and reply on this. its really helpful for me.
<spam links removed>
« Last Edit: May 29, 2013, 05:35:19 AM by MrPhil »

Offline annaharris

  • Spacescooter Operator
  • *****
  • Posts: 46
    • PHP Development Comapny
Re: Encapsulation?
« Reply #3 on: May 31, 2013, 03:17:24 AM »
encapsulation is an attribute of object design. It means that all of the object's data is contained and hidden in the object and access to it is restricted to members of that class.

Offline ivvyevents

  • Spaceship Captain
  • *****
  • Posts: 103
Re: Encapsulation?
« Reply #4 on: July 02, 2013, 10:48:52 AM »
Encapsulation is fundamental of oop(object-oriented programming) and it is used to hide the object's data inside the class. It is related to abstraction and information hiding.

 

Share |