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:
“From the war of nature, from famine and death, the most exalted object which we are capable of conceiving, namely, the production of the higher animals, directly follows. There is grandeur in this view of life, with its several powers, having been breathed into a few forms or into one; and that, whilst this planet has gone cycling on according to the fixed law of gravity, from so simple a beginning endless forms most beautiful and most wonderful have been, and are being, evolved.”
—Charles Darwin (18091882)
“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)
“I would urge that the yeast of education is the idea of excellence, and the idea of excellence comprises as many forms as there are individuals, each of whom develops his own image of excellence. The school must have as one of its principal functions the nurturing of images of excellence.”
—Jerome S. Bruner (20th century)