Object orgy

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(Related design heuristics)
Line 2: Line 2:
  
 
==Liabilities==
 
==Liabilities==
 +
*Harder to find bugs because any part of the system could have potentially changed the state of an object to cause a bug so it is harder to determine where the problem occurred.
 +
*Harder to reason about the behavior of an object because any part of the system can manipulate its internals.
 +
*If many parts of the system access the internals of an object, the result is difficult to maintain [[Spaghetti code]].
 +
*It is harder to change the internal workings of a class because the change can effect many other parts of the system.
 +
*Large public interfaces can make code hard to understand and obscure the original design.
  
 
==Related design heuristics==
 
==Related design heuristics==

Revision as of 03:50, 20 July 2009

This anti-pattern occurs when there is insufficient encapsulation in a system and objects just access each other's internals directly rather than going through a public interface.

Liabilities

  • Harder to find bugs because any part of the system could have potentially changed the state of an object to cause a bug so it is harder to determine where the problem occurred.
  • Harder to reason about the behavior of an object because any part of the system can manipulate its internals.
  • If many parts of the system access the internals of an object, the result is difficult to maintain Spaghetti code.
  • It is harder to change the internal workings of a class because the change can effect many other parts of the system.
  • Large public interfaces can make code hard to understand and obscure the original design.

Related design heuristics

Personal tools