cxxr / better-java

Resources for writing modern Java
Other
5.79k stars 730 forks source link

Review "Avoid lots of Util classes" #22

Closed jbgi closed 8 years ago

jbgi commented 8 years ago

I failed to see how the suggested alternative to Util classes is better. in fact it is much worse in my POV it pollute the class public API with concerns that ere irrelevant to its usage.

A better suggestion to address the problem would be to look for an existing library that offers better / more general solution to the problem at hand. And if no library offer the functionality you may want to do a contribution to one of them.

cxxr commented 8 years ago

The original thought came from some code I had to deal with where everyone would throw random methods into one big "Util" class. My thought with default methods on interfaces is that you would build a lot of little interfaces like mixins, and then use them when necessary.

In my experience, it doesn't really seem like a big win, so I'm leaning towards removing this section.