Suppose I have low level classes A, B, and C that are independent of each other. The functions in them take some input and does some computation and returns some output.
Now suppose I want to create an executable where it read in some data and output some statistics with the flow of
There are two options for me to handle this,
Create a high level class called ABC. It does no computation, it simply receives the input from the main function, parses the input and pass it into A.func1, and forward the output of A.func1 into B.func1, and forward the output of B.func1 into C.func1, and output it to the main function.
In the main function, directly parse the input itself, pass it into A.func1 and then B.func1 and then C.func1 and then save the output.
If class ABC does some computation internally while calling functions from A, B, and C, it's a no brainer that ABC class should exist. However, I am having a hard time to justify the need of a ABC class since it's just calling functions from low level class without any additional computation. It also means if we want to create 10 executables that are using the functions from the low level classes with different combination and order, we will have 10 of these high level classes.
However, I heard people said having a high level ABC class is better because Why should main() be short?
Which approach is better?