Encapsulation (computer programming): Difference between revisions

Content deleted Content added
Undid revision 483949120 by 59.92.54.36 (talk)
Line 13:
Hiding the internals of the object protects its integrity by preventing users from setting the internal data of the component into an invalid or inconsistent state. A benefit of encapsulation is that it can reduce system complexity, and thus increases [[robustness (computer science)|robustness]], by allowing the developer to limit the interdependencies between software components.
 
Almost always, there is a way to override such protection -&ndash; usually via reflection API (Ruby, Java, C#, etc.), sometimes by mechanism like name mangling ([[Python (programming language)|Python]]), or special keyword usage like <code>friend</code> in C++.
 
== General Definition ==