I'm updating some old Java 4 code to Java 8 (way too much to paste here) and the original programmer chose to have nearly every class of theirs extend this single HUGE class full of only static methods and constants, but I do not know their reasoning.
ex:
public class BaseClass{
/* this class has a huge amount of ONLY static methods/constants */
public static final int STUFF_DONE = 1;
public static String getStuff(){
String stuff = "this is my stuff.";
return stuff;
}
...
}
public class SuperClass extends BaseClass{
/* this class has only a few methods */
public String labelStuff(){
return getStuff();
}
}
public class MyClass extends SuperClass{
/* there are many classes that extend SuperClass like this one */
public int handleStuff(){
String myString = labelStuff();
return STUFF_DONE;
}
public static void main(){
if(handleStuff()) System.out.println("Done.");
}
}
My question is this... is it better to keep this design or is it better to remove the inheritance of the static methods/constants and simply call those methods/constants statically?
"Better" to me is defined as lower memory consumption (again, this base class is quite huge) as CPU is likely not affected by this. What are the benefits/pitfalls of this approach?
My concern is that because BaseClass is so huge that I'm wasting a LOT of memory for usage of only one or two methods/constants in the inheriting classes that I could just be calling statically.