Glossary · Automation software engineering and architecture
Code module
Also known as: Software module, Module
German: Codemodul
In software engineering, a code module is a self-contained unit of source code, such as a file, package, library or program organization unit, that groups related functionality behind a defined interface and can be developed, tested and reused separately.
- Software engineering
In one sentence
A code module is a self-contained unit of source code that groups related functionality behind a defined interface.
Example
The palletizer project is split into code modules for layer patterns, gripper control and conveyor handling, each with its own tests and version.
How it applies
- Engineering: Modules make large programs manageable. In IEC 61131-3 projects, modules are typically function blocks, functions, programs and libraries; in firmware, they are source files or packages.
- Maintenance: Good modules have high Cohesion and low Coupling, so changes stay local and testing effort stays proportionate. Module boundaries also define units for reuse across machines.
- Documentation: Each module should have a short description of its purpose, interface, dependencies and version. Library documentation for PLC modules is often what machine builders and service engineers read most, so keep it accurate and generated from the source where possible.
Module vs. component
A module is a unit of code organization. A component is a unit of deployment and composition with explicit interfaces, often built from several modules. In Component-based architecture, components are replaced as a whole; modules are the building blocks inside them. Usage varies between teams, so define both terms in the project's architecture documentation.