We have a service in Java that deals with a lot of user-uploaded files, and tasks that prepare these files for different models to execute with.
One such phase of preparation included overriding values in json files. 4 out of 10 tasks were supposed to do this.
I created a static utility class that contained a function to override a value in a json file, something like
public static class ParameterUtils {
public static String overrideParameter(String originalContent, String key, String newValue) {
//4 lines of code that overrides this value and return modified content.
}
}
However, my senior developers said that this utility class hardly offers any value, while I was trying to preserve the DRY principle. At the end I did get rid of this utility class, and now the 4 lines of code to override a value in a json file reside in 4 different files.
Do you think that this class and method are not good from OOP's view? Why and why not?