Content deleted Content added
No edit summary |
Calabe1992 (talk | contribs) m Reverted edits by 122.54.213.203 (talk) to last revision by Ohnoitsjamie (HG) |
||
Line 1:
In a programming language <!-- [[object-oriented programming language]]--> <!-- and related fields, like [[OODMBS]],--> '''encapsulation''' is used to refer to one of two related but distinct notions, and sometimes to the combination<ref>Michael Lee Scott, ''Programming language pragmatics'', Edition 2,
* A language mechanism for restricting access to some of the [[object (computer science)|object]]'s components.<ref>[[John C. Mitchell]], ''Concepts in programming languages'', Cambridge University Press, 2003, ISBN 0521780985, p.522</ref><ref name=Pierce>{{cite book|last=Pierce|first=Benjamin|authorlink=Benjamin C. Pierce|title=[[Types and Programming Languages]]|publisher=MIT Press|year=2002|id=ISBN 0-262-16209-1}} p. 266</ref>
* A language construct that facilitates the bundling of data with the methods <!-- I object to the word method being used here because in lisp languages programmers cannot distinguish methods from normal functions at the call site. Behavior equivalent to methods may be implemented as normal functions. encapsulation is not dependent on implementation but on behavior--> (or other functions) operating on that data.<ref>Wm. Paul Rogers, [http://www.javaworld.com/javaworld/jw-05-2001/jw-0518-encapsulation.html?page=9 ''Encapsulation is not information hiding''],
Some programming language researchers and academics use the first meaning alone or in combination with the second as a [[Object oriented programming#features|distinguishing feature of object oriented programming]], while other programming languages which provide [[Closure (computer programming)|lexical closures]] view encapsulation as a feature of the language orthogonal to object orientation.
|