Assuming you are talking about the concept of calling methods from other methods to multiple depths then this is very common practice. If it wasn't then for anything but the most basic program you would end up with programs with a few methods each containing hundreds of thousands of lines of repeated code in.
posted 1 year ago
Would this be better than the earlier one?
Reason I see is that, having all the calls in one method makes my life simpler to understand what is happening at a higher level rather than having to go down method by method.
(provided the method names make sense)
Just something striked my thought and hence posted the question.
Always consider context. Your example doesn't give a context. They're just nonsense names and nonsense methods so you can't really say that one way is better. What you need to consider is whether it makes sense to organize the method calls in one way or another and what the goal is at each level of organization. Are you trying to write a composed method or are you delegating to another method? The answer to those questions would help determine how you'd structure the calls.
Correct me if I am wrong, but I think what you are trying to say is... In your current learning point of the Java language, where your application is mostly on the simpler side, and where you are mostly working on your own, perhaps a more "flat" design is better. Perhaps, or perhaps not. I think it is debatable.
Of course, this kinda doesn't make much sense when you are part of a team of dozens, working with lots of jar files, and on a complex application.
My concern here is, can this be generalize? Is there a point where this "flat" concept is more hurtful than helpful? When there are jar files involved? When there are more than 2 people on the project? 3 people? My speculation is that it is more complex than that, and this generalization probably more trouble than it is worth.