Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In a software project, how would you differentiate a Component from a Module? [closed]

In a software, how would you differentiate a Component from a Module?

like image 390
Jarvis Avatar asked Jun 22 '09 15:06

Jarvis


People also ask

What is the difference between a component and 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.

What is the difference between component and module in Angular?

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.

What is a module in a project?

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.

What is a module in a software?

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.


2 Answers

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.

like image 66
Matthias Avatar answered Oct 07 '22 02:10

Matthias


Generally speaking,

  • a component is a relatively finely grained grouping of elements that serve a particular service in the solution.
  • a module is courser grained and acts as a grouping of one or more related services provided by the software.

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 !

like image 43
Tom Carter Avatar answered Oct 07 '22 00:10

Tom Carter