At first, as a general reminder, just remember to use inheritance as a replacement, not as reuse code. Roughly this means that everything that inherits from your base module should support (basically) the same operations, and if the user says open , close or update on any module, it will provide the expected results.
Do you really need a module manager? Perhaps it would be better to draw a diagram of the relationships between your various classes / modules and create a connection there, rather than a top-level manager. Then the main application loop will know about one or more high-level modules and immediately call the appropriate methods. If desired, there may even be a high-level module to manage this high level of delegation.
For your console example, assuming you don't want to support multiple consoles, you probably better just keep the namespace: it gives you the ability to directly refer to the only console you are interacting with. Alternatively, you may need to pass a “parent console” to each module you create and use the appropriate console to perform your I / O operations. This gives you more flexibility by making sure you need to support the console in the base module.
Mark b
source share