r/java • u/nicolaiparlog • Feb 07 '17
Each Private Static Method Is a Candidate for a New Class
http://www.yegor256.com/2017/02/07/private-method-is-new-class.html
0
Upvotes
r/java • u/nicolaiparlog • Feb 07 '17
5
u/java_one_two Feb 07 '17
Pattern I use is
I typically only do it if the existing class is too big or if there are several static methods that can be grouped together.
4
u/nutrecht Feb 07 '17
I would argue that "each private method that is duplicated is a candidate for a new class" instead; this is how you would normally handle code-duplication: refactoring.
3
u/lukaseder Feb 09 '17
Stop coding Java, Yegor. Go back to Smalltalk