In a software, how would you differentiate a Component from a Module?
Components are put together (synthesis) to build a software. Modules are the result of dividing (analysis) the code. So components are about the high-level design of a software, whereas modules are more about organization on the code level.
The Component is a fundamental block of Angular and multiple components will make up your application. A module can be a library for another module. For instance, the angular2/core library which is a primary Angular library module will be imported by another component.
A module is a collection of source files and build settings that allow you to divide your project into discrete units of functionality. Your project can have one or many modules, and one module may use another module as a dependency. You can independently build, test, and debug each module.
In computer software, a module is an extension to a main program dedicated to a specific function. In programming, a module is a section of code that is added in as a whole or is designed for easy reusability.
I would say that the answer depends on who you ask.
I think of the difference as being one of granularity and role. A software component to my understanding is a self-contained entity with a well-defined (and preferrably stable) interface that interacts with the remaining parts of a system, and which has significant meaning from a system architecture point of view. An example would be a data access abstraction layer.
A module to me would rather be a deployable source code bundle containing code which shares a common purpose, but doesn't perform any significant role in the system (which means replacing it would not require changes to the system's overall architecture). An example would be a JSON serializer in a web service.
Generally speaking,
A module will tend to make use of many componenents to provide its services whereas a component will likely to be constructed from a handful of classes and other components.
In any case its subjective and depends on the scale of the application. For a small application there is likely to be a single program (a module) and a number of components. In medium sized application there could be several modules and many components. In a large application you might want to introduce the term sub-system which is even more courser grained than a module !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With