Modular programming enables one to organize code into independent, cohesive modules, which can be combined to achieve the desired functionality. This allows us to create code that is:
- More cohesive, because the modules are built with a specific purpose, so the code that resides there tends to cater to that specific purpose.
- Encapsulated, because modules can interact with only those APIs that have been made available by the other modules.
- Reliable, because the discoverability is based on the modules and not on the individual types. This means that if a module is not present, the dependent module cannot be executed until it is discoverable by the dependent module. This helps to prevent runtime errors.
- Loosely coupled. If you use service interfaces, the module interface and the service interface implementation can be loosely coupled.
So, the thought process in designing...