Object Orgy - Forms

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:

    Pervading nationalism imposes its dominion on man today in many different forms and with an aggressiveness that spares no one.... The challenge that is already with us is the temptation to accept as true freedom what in reality is only a new form of slavery.
    Pope John Paul II (b. 1920)

    Year chases year, decay pursues decay,
    Still drops some joy from with’ring life away;
    New forms arise, and diff’rent views engage,
    Samuel Johnson (1709–1784)

    The government, which is the supreme authority in states, must be in the hands of one, or of a few, or of the many. The true forms of government, therefore, are those in which the one, the few, or the many, govern with a view to the common interest.
    Aristotle (384–323 B.C.)