Encapsulation

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
Encapsulation means the enclosing internal features or ideas.
 
Encapsulation means the enclosing internal features or ideas.
 +
 +
There are two important parts to encapsulation:
 +
* Decomposing a system into small, self-contained chunks such as packages and classes. This makes the complexity of the system more manageable because developers can look at just one chunk at a time.
 +
* Hiding the internal details of one chunk from the rest of the system ([[Information hiding]]).
  
 
In the context of computer science, this term means the logical separation of a concept from another. Often this is related to the [[Information hiding|hiding of information]] behind a defined interface.
 
In the context of computer science, this term means the logical separation of a concept from another. Often this is related to the [[Information hiding|hiding of information]] behind a defined interface.

Revision as of 05:35, 28 August 2009

Encapsulation means the enclosing internal features or ideas.

There are two important parts to encapsulation:

* Decomposing a system into small, self-contained chunks such as packages and classes. This makes the complexity of the system more manageable because developers can look at just one chunk at a time.
* Hiding the internal details of one chunk from the rest of the system (Information hiding). 

In the context of computer science, this term means the logical separation of a concept from another. Often this is related to the hiding of information behind a defined interface.

In OO design, this term takes on a stronger meaning. Not only is encapsulation from the user, other computing entities or even other programs, but also within programs themselves.

In OO design, several different types of encapsulation are proposed:

External References

See Also


Personal tools