Wednesday, April 05, 2017

Modular design

The most important software design principle is separating the system into independent modules. By modules, I mean separately compilable units that can be "easily" unit tested. Benefits of modular software design:
  • It will be harder to introduce unintentional side effects like
    • Adding dependencies to code not related to the module.
    • Delete code that is not related to the module.
  • Modules can be designed separately which decreases mental load.
  • Each module will have its own unit tests, when unit tests are run, not the whole project but only that module will be built.
  • Each module will have its own string resource file instead of a giant resource file for the whole project.
  • Bad design (usually due to inexperience, time pressure or plain laziness) will be limited to the module in question and won’t be a project wide cancer.
  • There will be less merge problems.
  • Portions that have higher security requirements can be dealt with locally in modules instead of affecting the whole code.
  • Being able to test modules independently helps in identifying bugs like memory leaks.
  • It will be easier to define and assign tasks to developers. As long as the inter-module interfaces are clearly defined, integration will be easy.
  • It will be easier to estimate time and resource requirements.
  • If will be easier to reuse the module in other projects.
  • A module might be used standalone to do some tasks that does not require the whole system to be online.
  • If MVC was used, desktop GUI can be quickly converted to web front end and logic can be used as back-end and the whole application can be converted to a web application.

No comments: