Forms
Encapsulation may be weakened by declaring internal members public or by providing free access to data via public getter/setter methods. The access need not be public: for details see e.g. Java access modifiers and the Accessibility Levels in C# (MSDN). In C++, encapsulation is also weakened by declaring friend
-classes or -functions.
An object may also make its internal data accessible by passing references to them as arguments to methods or constructors of other classes, which may retain references.
On the other hand, objects holding references to one another, though sometimes described as a form of object orgy, does not in itself breach encapsulation.
Read more about this topic: Object Orgy
Famous quotes containing the word forms:
“The method of authority will always govern the mass of mankind; and those who wield the various forms of organized force in the state will never be convinced that dangerous reasoning ought not to be suppressed in some way.”
—Charles Sanders Peirce (18391914)
“You may melt your metals and cast them into the most beautiful moulds you can; they will never excite me like the forms which this molten earth flows out into. And not only it, but the institutions upon it are plastic like clay in the hands of the potter.”
—Henry David Thoreau (18171862)
“All forms of beauty, like all possible phenomena, contain an element of the eternal and an element of the transitoryof the absolute and of the particular. Absolute and eternal beauty does not exist, or rather it is only an abstraction creamed from the general surface of different beauties. The particular element in each manifestation comes from the emotions: and just as we have our own particular emotions, so we have our own beauty.”
—Charles Baudelaire (18211867)