3 ms·
> God Class I don't understand how to avoid this even if you break it up in smaller classes. You still need a point of entry where the logic begins and where i
by Kiro 12y ago
> God Class
I don't understand how to avoid this even if you break it up in smaller classes. You still need a point of entry where the logic begins and where it is decided which components to use. ThIs always means some kind of Manager or Main class for me. How do I fix it?
- adrusi 12y agoWell there's an entry point of course, but it shouldn't know much. Your entry point knows about your option parser which knows about the high-level actions your program performs which know about the sub-processes involved in accomplishing them, etc. It's important to keep this graph as acyclic as possible, and to try not to have any one component directly interact with too many other components, because then your abstraction is too fragile.
- kibibu 12y agoTake it all with a grain of salt. Here's a (vaguely) contrasting view from John Carmack: http://number-none.com/blow/john_carmack_on_inlined_code.html http://number-none.com/blow/john_carmack_on_inlined_code.htm... The main takeaway is that inlining a bunch of code to flatten the dependency tree may actually reveal problems and reduce your maintenance burden.