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:
“Your letter is come; it came indeed twelve lines ago, but I
could not stop to acknowledge it before, & I am glad it did not
arrive till I had completed my first sentence, because the
sentence had been made since yesterday, & I think forms a very
good beginning.”
—Jane Austen (17751817)
“An expense of ends to means is fate;Morganization tyrannizing over character. The menagerie, or forms and powers of the spine, is a book of fate: the bill of the bird, the skull of the snake, determines tyrannically its limits.”
—Ralph Waldo Emerson (18031882)
“The highest perfection of politeness is only a beautiful edifice, built, from the base to the dome, of ungraceful and gilded forms of charitable and unselfish lying.”
—Mark Twain [Samuel Langhorne Clemens] (18351910)