Object Orgy - Consequences

Consequences

The consequences of an object orgy are essentially a loss of the benefits of encapsulation:

  • Unrestricted access makes it hard for the reader to reason about the behaviour of an object. This is because direct access to its internal state means any other part of the system can manipulate it, increasing the amount of code to be examined, and opening the door to future abuse.
  • As a consequence of the difficulty of reasoning, design by contract is effectively impossible.
  • If much code takes advantage of the lack of encapsulation, the result is a scarcely maintainable maze of interactions, commonly known as a rat's nest or spaghetti code.
  • The original design is obscured by the excessively broad interfaces to objects.
  • The broad interfaces make it harder to re-implement a class without disturbing the rest of the system. This is especially hard when the clients of the class are developed by a different team or organisation.

Read more about this topic:  Object Orgy

Famous quotes containing the word consequences:

    Results are what you expect, and consequences are what you get.
    schoolgirl’s definition, quoted in Ladies’ Home Journal (New York, Jan. 1942)

    There is a delicate balance of putting yourself last and not being a doormat and thinking of yourself first and not coming off as selfish, arrogant, or bossy. We spend the majority of our lives attempting to perfect this balance. When we are successful, we have many close, healthy relationships. When we are unsuccessful, we suffer the natural consequences of damaged and sometimes broken relationships. Children are just beginning their journey on this important life lesson.
    —Cindy L. Teachey. “Building Lifelong Relationships—School Age Programs at Work,” Child Care Exchange (January 1994)

    Resistance is feasible even for those who are not heroes by nature, and it is an obligation, I believe, for those who fear the consequences and detest the reality of the attempt to impose American hegemony.
    Noam Chomsky (b. 1928)