Content deleted Content added
Undid revision 1083692907 by 103.60.209.253 (talk) |
The old definition was wrong! In the source [1] of definition we can see that THE HIDDING is NOT ENCAPSULATION! The old definition is confusing. Tags: Reverted Visual edit |
||
Line 1:
{{Short description|Bundling of data}}
In [[object-oriented programming]] (OOP), '''encapsulation''' refers to the bundling of data with the methods that operate on that data
Publicly accessible methods are generally provided in the class to access or modify the state more abstractly. In practice sometimes methods (so-called [[Mutator method|"getters" and "setters"]]) are provided to access the values indirectly, but, although not necessarily a violation of abstract encapsulation, they are often considered a sign-post of potentially poor object-oriented programming (OOP) design practice <ref>{{cite web |url=https://www.infoworld.com/article/2073723/why-getter-and-setter-methods-are-evil.html |title=Why Getter and Setter methods are evil |last=Holub |first=Allen |publisher=JavaWorld |date=September 5, 2003 |website=Info World |archive-url=https://web.archive.org/web/20200729073721/https://www.infoworld.com/article/2073723/why-getter-and-setter-methods-are-evil.html |access-date=January 17, 2021|archive-date=2020-07-29 }}</ref> (an [[Anti-pattern]]).
|