4 ms·
It depends a lot on what you do with the static method. If it's side-effect free, an Utils class with static methods can be a good way to test some business cod
by mercurial 12y ago
It depends a lot on what you do with the static method. If it's side-effect free, an Utils class with static methods can be a good way to test some business code without exposing private methods.
If it's impure, run away.
- chopin 12y agoYes, the Utils class is easier to test. But its clients are harder to test, if the Utils class crosses component Boundaries or rely on a fat runtime (such as an JEE server or an OSGi runtime) being up and running.