An object that knows too much or does too much.
Problems
Cohesion
Solutions
- Split responsibilities.
- Follow Single Responsibility Principle.
- Follow The Boy Scout Rule.
Examples
- Libraries
Exceptions
Sample Code
Wrong
Right
Detection
Linters can count methods and warn against a threshold.
Tags
- Cohesive
Conclusion
Libraries were fine in the 60. In Object Oriented Programming we will distribute responsibilities among many objects.
Also Known as
- Large Class
More info
Credits
Photo by Francisco Ghisletti on Unsplash
Discussion (0)