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:
“There are these sudden mobs of men,
These sudden clouds of faces and arms,
An immense suppression, freed,
These voices crying without knowing for what,
Except to be happy, without knowing how,
Imposing forms they cannot describe,
Requiring order beyond their speech.”
—Wallace Stevens (18791955)
“The blood weeps from my heart when I do shape,
In forms imaginary, th unguided days
And rotten times that you shall look upon
When I am sleeping with my ancestors.”
—William Shakespeare (15641616)
“It is given to few to add the store of knowledge, to strike new springs of thought, or to shape new forms of beauty. But so sure as it is that men live not by bread, but by ideas, so sure is it that the future of the world lies in the hands of those who are able to carry the interpretation of nature a step further than their predecessors.”
—Thomas Henry Huxley (182595)