Avoid the God class

This is one of the very common issues in application development, where a class either has too many lines of code or knows too much about the application or plays too many roles in an application. This type of a class is known as the God class. For example, it is a best practice that triggers should not contain business logic, and therefore we create helper classes. Sometimes, we create utility classes as well. By the time the development phase of a project progresses, these classes become huge and are referred to by many other classes. In such situations, refactoring of code becomes very tough and may break other parts of the application. As expected, developers avoid changing anything that exists in the God class, and therefore ...

Get Apex Design Patterns now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.