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:
“We are still barely conscious of how harmful it is to treat children in a degrading manner. Treating them with respect and recognizing the consequences of their being humiliated are by no means intellectual matters; otherwise, their importance would long since have been generally recognized.”
—Alice Miller (20th century)
“Every expansion of government in business means that government in order to protect itself from the political consequences of its errors and wrongs is driven irresistibly without peace to greater and greater control of the nations press and platform. Free speech does not live many hours after free industry and free commerce die.”
—Herbert Hoover (18741964)
“The consequences of our actions grab us by the scruff of our necks, quite indifferent to our claim that we have gotten better in the meantime.”
—Friedrich Nietzsche (18441900)