God object

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
m
m (Reverted edits by Ebybymic (Talk); changed back to last version by Matthew Harward)
 
(2 intermediate revisions by 2 users not shown)
Line 10: Line 10:
 
* The Blob
 
* The Blob
 
* Winnebago
 
* Winnebago
 +
* Supernova (New God Class - Software Evolution Metaphor)
 +
* Red Giant (Permanent God Class - Software Evolution Metaphor)
  
 
==Liabilities==
 
==Liabilities==

Latest revision as of 03:10, 25 November 2010

God object is an anti pattern that occurs when one class / object is knows or does too much. God objects (or classes) contain a lot of functionality and fulfill more than one responsibility. They should be split up into several objects / classes.

God objects conflict with the object oriented paradigm because they don't really represent a single domain entity but usually consist of a number of different domain concepts all combined into one massive object. Such a practice greatly compromises the maintainability and understandability of code.

Nevertheless, god objects are sometimes used in domains where performance is more important than maintainability, including in hardware and micro controller programming.

Also Known As

  • God class
  • God object
  • The Blob
  • Winnebago
  • Supernova (New God Class - Software Evolution Metaphor)
  • Red Giant (Permanent God Class - Software Evolution Metaphor)

Liabilities

  • God objects make maintenance very difficult because the god object is referenced so much in other code that making changes to it has widespread effects on the rest of the system.
  • God objects make a system harder to understand because the task performed by the object is unclear and there is usually a lot of code in god classes.

Related design heuristics


Personal tools