Definition of and difference between modules and components

Posted on Jan 31, 2022

If you search for my title, you’ll find a lot of discussions about the differences of modules and components.

By reading literature about software architecture I also tried to get a definition of it. In my opinion it is really important to have a good overview what this terms mean to communicate ideas without any problems.

So let me share with you what I found out about them.

Modules

Modules are a set of parts or independent units. They can be used to create a more complex structure.

So code which is related to each other creates a module.

In the Java world you’d say that a package is a module. In a package you can find a group of classes which are bounded together to a module.

For an architect it is really important to avoid a too high coupling between modules. This shall ensure the reusability and interchangeability of modules.

Components

The physical manifestation of a module is defined as a component. So packaging a Java application into .jar file will create a component.

Thinking of the simplest component is a library: A wrapper of code.

One component can contain different modules and bundle them together to a service.

For an architect it is important to identify components in a new project.

This can happen by a discovering components process.

You could mean the same when you talk about components and modules. If you do this just ask yourself: Are you looking at it during the development or after you have bundled your code?

Want to know more?

Keep on reading and choose one of the related articles. You can also check the home page for my latest thoughts, notes and articles.