DEV Community

In defense of the “god object” pattern

Andrew Lucker on May 21, 2017

… or “In advocacy of the total submission pattern” HTML is a great and durable protocol, but something hard to generalize in the world of Turing...
Collapse
 
courier10pt profile image
Bob van Hoove

The 'god object' reference in the title might be a bit misleading.

God objects are more like an OOP anti-pattern. It's usually some (static) class that knows about too many things and it is referred to by many classes. So the codebase is tightly knit to the god object. God objects make it harder to reuse code, and if it keeps it's own state it also makes the code harder to reason about.

HTML and SQL are languages. At best it helps expressing various query needs or document structures in a more concise manner. Dealing with other languages should not lead to the anti-pattern described above, but that's up to the developer.