God Object
noun
say it: “GAHD OB-jekt” /ɡɑd ˈɑbdʒɛkt/
One class that knows and does everything, so every change in a program goes through it.
What is a god object?
A god object (also called a god class) is one class that knows and does everything: a GymManager that books classes, bills members, sends emails, prints reports and resets the door codes. Every change goes through it, two people are always editing it, and nobody can change it safely. It's both a code smell and an anti-pattern, and the cure is to pull out a class for each job until it has one reason to change.
In a sentence
- “Every ticket at the gym ended in the same file, because the manager class had become a god object.”
Level: Journeyman · More Software Development terms at this level
Updated