On Wed, Sep 16, 2020 at 8:31 AM Jochen Wiedmann <jochen.wiedm...@gmail.com> wrote: > > On Sun, Sep 6, 2020 at 3:39 PM Gary Gregory <garydgreg...@gmail.com> wrote: > > > The idea behind making *Util constructors private is that it does not make > > sense to instantiate a class that only has static methods. > > True, but that also eliminates reuse by subclassing, and similar > techniques. In my opinion, static utility methods are discouraged in > the age of injected dependencies.
If a class only has static methods, there is nothing to "reuse" that can't be reused by a plain static call. You can't override static methods anyway. I would like to see other Commons code like Lang's StringUtils evolve with an insatiable version where you can say something like: StringsHelper.create(Case.INSENSITIVE or a builder).someMethod(foo, bar); StringsHelper.INSENSITIVE.someMethod(foo, bar); Gary Then, yes it makes sense to allow subclassing. > > Jochen > > > > -- > > Look, that's why there's rules, understand? So that you think before > you break 'em. > > -- (Terry Pratchett, Thief of Time) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org