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:
“Tis education forms the common mind,
Just as the twig is bent, the trees inclined.”
—Alexander Pope (16881744)
“A painter told me that nobody could draw a tree without in some sort becoming a tree; or draw a child by studying the outlines of its forms merely,but by watching for a time his motions and plays, the painter enters into his nature and can then draw him at will in every attitude.”
—Ralph Waldo Emerson (18031882)
“Cultures essential service to a religion is to destroy intellectual idolatry, the recurrent tendency in religion to replace the object of its worship with its present understanding and forms of approach to that object.”
—Northrop Frye (b. 1912)