What Are Components?

The taxonomy of software systems can be downright confusing.

What are components? How do they differ from modules and classes?

Systems are composed of Components

components in a system

Components are conglomerations of modules.

modules in a component

 

At the same time, modules are cohesive packages of data structures and functions that act on those data structures. Classes are modules.

Why are systems composed of components? Because…

Components are the unit of deployment.

In other words, a component is the smallest deployable part in a system—a file or set of files.

 

Different languages and frameworks produce different types of components. For example:

  • .NET has .dll files,
  • In JavaScript, components are .js files,
  • For distribution, Java produces .jar files

In compiled languages, the compiler produces binary files for distribution. With interpreted languages, components are the source files. 

Even monolithic applications are usually composed of several components—unless they are trivial and a single component will suffice.

 

Since components are files, we can independently deploy them. Instead of replacing all the components for a small, confined system change, we have the option of redeploying the one or two modified components. We may replace a component without necessarily having to change others. Sure, often, there are dependencies between components.

However, one aspect of good component design might be a minimisation of such dependencies between components. We’ll get to this point another time.

 

What if we wanted to replace one component with another? Say, we have a .NET solution with a Console app project and several referenced Class Library projects. The Console app project compiles into an executable file while the Class Library projects compile to DLL files.

Let’s say the DLL providing application-specific data access is faulty—it contains a minor defect. We go ahead and fix the bug and build the data access project into an updated data access DLL file. 

When we deploy this new DLL file, replacing the old, buggy component, the system will no longer have the data access bug. 

We have only replaced a component, not the entire application. 

Components are the unit of deployment.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply