Modular Design
updated 21 April 2022
We always hear modular design in software development. Components can be reused in different situations where you don’t need to create a new system from scratch. And what makes it modular is the fact that you don’t need to use all the components in your project or build, except those that you need.
Take for example the electronic components. These components can be used to create integrated circuits for any electronic device. You don’t need to install them all except those parts needed in your project.
Modular in Software Dev
A lot of frameworks are modular. The Spring Framework is one through Java beans. These beans are reusable. They are not tied to any specific project. It only means a software developer, when writing a new project does not need to always start from scratch. Modules can be combined to create the project.
When you are writing code, you can make it modular too. You write every file with a specific function or a group of functionalities. Others who need a specific functionality may use your code if it is what he needs. But he does not need to download the entire project just to use your code. This is a simple way to implement modular design in computer programming.
Now, in large-scale projects, you can make it modular in terms of interfaces. When you design a project with well-defined interfaces, components will adhere to it. So a developer can contribute to your project, in any style he wants, as long as his contribution adheres to your interfaces.
Think of modular building: every component of the house can be upgraded without the need to change the entire house, simply by replacing the component to be upgraded. This is cost-effective and thereby practical. This can be achieved through a well-defined design: there must be a specific standard where all concerned components will adhere to. In this way, those manufactures that wish to create those components can add a lot of features, styles and mechanisms provided it follows the standards.
Finally, when you focus on writing your project based on a standard
(the interface), you are doing what they call programming to an interface
.
When you do that, your project can be upgraded without breaking it.