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:

    The mind can make
    Substance, and people planets of its own
    With beings brighter than have been, and give
    A breath to forms which can outlive all flesh.
    George Gordon Noel Byron (1788–1824)

    ‘Tis education forms the common mind,
    Just as the twig is bent, the tree’s inclined.
    Alexander Pope (1688–1744)

    While waiting to get married, several forms of employment were acceptable. Teaching kindergarten was for those girls who stayed in school four years. The rest were secretaries, typists, file clerks, or receptionists in insurance firms or banks, preferably those owned or run by the family, but respectable enough if the boss was an upstanding Christian member of the community.
    Barbara Howar (b. 1934)