Glossary · Automation software engineering and architecture
Design pattern
Also known as: Software design pattern
German: Entwurfsmuster
In software engineering, a design pattern is a named, reusable solution to a recurring design problem within a software component, describing the participating elements, their relationships and the trade-offs, without prescribing specific code. Well-known examples include the adapter, facade, factory, observer and state patterns.
- Software engineering
In one sentence
A design pattern is a named, reusable solution to a recurring design problem within software, such as adapter, factory or observer.
Example
The team implements machine operating modes with the state pattern, so each mode is a separate class with its own allowed transitions.
How it applies
- Engineering: Patterns give developers a shared vocabulary: saying 'use an adapter here' communicates a whole design idea. With object-oriented extensions of IEC 61131-3, many classic patterns can be applied to PLC code as well.
- Reviews: Patterns help, but applying them where they are not needed adds complexity. Reviewers should ask which problem a pattern solves in the specific case.
- Documentation: Name the patterns used in design documentation and code comments. For library users and service engineers, explain the resulting behavior, such as how modes change, rather than the pattern itself.
Design pattern vs. architecture pattern
A design pattern solves a local problem inside a component. An Architecture pattern shapes the structure of a whole system. Automation also has domain-specific patterns, such as the ISA-88 state model for equipment and PackML states for packaging machines, which work like design patterns for machine behavior.