Your class should be an abstraction of a real life entity with no "validators," "controllers," "managers," etc. If your class name ends with an "-er"—it's a bad design. BTW, here are my seven virtues of a good object. Also, this post explains this idea in more details: Don't Create Objects That End With -ER.
And, of course, utility classes are anti-patterns, like StringUtils
, FileUtils
, and IOUtils
from Apache. The above are perfect examples of terrible designs. Read this follow up post: OOP Alternative to Utility Classes
Read full article from Typical Mistakes in Java Code
No comments:
Post a Comment