> Markdown version of [/videos/742-how-to-domain-model-an-example-from-manufacturing](https://www.wearedevelopers.com/videos/742-how-to-domain-model-an-example-from-manufacturing). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # How to Domain Model – An example from manufacturing Programming 25-million-euro machinery is like playing Sudoku on a Rubik's cube. Learn how Domain-Driven Design tames cyber-physical complexities. Isolate hardware dependencies and prevent catastrophic robotic misalignments. - **Speakers:** [Hendrik Lösch](https://www.wearedevelopers.com/@hendrik-losch) - **Event:** World Congress 2023 - **Published:** October 6, 2023 - **Duration:** 29:54 - **URL:** https://www.wearedevelopers.com/videos/742-how-to-domain-model-an-example-from-manufacturing ## Summary Cyber-physical systems operate at the critical intersection of software and hardware, presenting immense challenges outside the realm of traditional web or application development. In advanced manufacturing—such as programming multi-million-euro lithography and glass mask repair machines—unmanaged hardware and process variations quickly trigger exponential complexity, comparable to playing Sudoku on a Rubik's cube. Traditional software patterns often fail here because developers prematurely fixate on technology solutions and framework implementations rather than deeply understanding the physical processes and constraints. Domain-Driven Design (DDD) intercepts this complexity by rigidly separating the problem space from the solution space. By applying tools like event storming, engineering teams can trace workflows based on desired end-states before touching any implementation details. Establishing a common ubiquitous language eliminates dangerous operational ambiguities; for instance, distinctively modeling a "location on a mask" versus a "position inside a machine" prevents catastrophic robotic misalignments. This shared taxonomy forms the foundation of a robust domain model that captures real-world interactors, their data, and behavior, rather than relying on reverse-engineered database schemas. To translate these domain models into scalable code, the problem space is divided into bounded contexts like defect repair and mask handling. Following clean architecture principles, physical hardware components are mapped as aggregate roots, entities, and specialized domain objects like actuators and sensors. By isolating these core models from volatile external dependencies, hardware API variations are effectively insulated behind outer service modules utilizing gRPC. This allows developers to thoroughly test software logic and accommodate new hardware suppliers without requiring continuous access to unpredictable, 25-million-euro production machinery. **Keywords:** cyber-physical systems, domain-driven design, event storming, ubiquitous language, bounded contexts, clean architecture patterns, hardware abstraction layers, aggregate root modeling, entity state management, manufacturing software architecture, domain entity logic, grpc communication, software variation management, service module abstraction, legacy software refactoring ## Chapters 1. **Introduction to cyber-physical systems and software** (00:03) — Combining hardware operations with tailored software enables advanced functionality in massive industrial machines. 1. **Controlling complexity caused by physical product variations** (03:03) — Mixing hardware suppliers and different workflow paths causes a combinatorial explosion of required software logic. 1. **Dividing problem space and solution space with DDD** (05:44) — Domain-driven design separates pure business constraints from technological frameworks to prevent premature implementation bias. 1. **Discovering domain elements using event storming workshops** (09:15) — Modeling reverse-chronological business outcomes and commands reveals natural system interactions without overcommitting to technical details. 1. **Defining bounded contexts for hardware operations** (12:45) — Grouping related physical workflow tasks isolates different subdomains to keep architectural responsibilities distinct. 1. **Resolving ambiguity with clear ubiquitous language terms** (13:59) — Standardizing definitions across interconnected models prevents confusing overlaps between geographic machine layouts and physical component states. 1. **Translating strategic domains into tactical code patterns** (16:39) — Tactical modeling elements like aggregates, entities, and factories encapsulate specific hardware initialization and coordination within the codebase. 1. **Customizing domain patterns for physical hardware states** (23:32) — Extending logic models to include actuators and finite state machines addresses the inherently stateful reality of mechanical systems. 1. **Insulating hardware dependencies via clean architecture layers** (25:38) — Service wrappers and structural abstraction mechanisms allow engineers to swap out proprietary hardware without rewriting core workflows. 1. **Final benefits of relying on strict domain models** (28:37) — Aligning software processes directly with the physical domain limits downstream code breakage when underlying infrastructure changes. ## Related Moments - [Overview of domain-driven design techniques](https://www.wearedevelopers.com/videos/1571-20-years-of-domain-driven-design-what-i-ve-learned-about-ddd) (from "20 Years of Domain-Driven Design: What I’ve Learned About DDD") - [Building disciplined domain models for event-driven systems](https://www.wearedevelopers.com/videos/163-cqrs-and-event-sourcing-without-the-pixie-dust) (from "CQRS and Event Sourcing without the pixie dust") - [Rediscovering domain knowledge through collaborative modeling techniques](https://www.wearedevelopers.com/videos/845-domain-driven-transformation-how-to-bring-back-sustainable-architecture-to-legacy-and-monoliths) (from "Domain-Driven Transformation—How to Bring (Back) Sustainable Architecture to Legacy and Monoliths") - [Utilizing domain-driven design for effective data models](https://www.wearedevelopers.com/videos/19-building-high-performance-and-scalable-architectures-for-enterprises) (from "Building high performance and scalable architectures for enterprises") - [Structuring engineering teams around domain bounded contexts](https://www.wearedevelopers.com/videos/64-shared-mobility-for-everyone) (from "Shared mobility for everyone!") - [Identifying bounded contexts using domain-driven design principles](https://www.wearedevelopers.com/videos/987-modulith-instead-of-monolith-pragmatically-towards-microservices) (from "Modulith Instead of Monolith - Pragmatically Towards Microservices") ## Related Articles - [Now is the time for industrialized software development](https://www.wearedevelopers.com/magazine/601-now-is-the-time-for-industrialized-software-development) - [Why Event-Driven Architecture Isn’t About Speed (and When You Actually Need It)](https://www.wearedevelopers.com/magazine/745-why-event-driven-architecture-isn-t-about-speed-and-when-you-actually-need-it) - [MLops – Deploying, Maintaining And Evolving Machine Learning Models in Production](https://www.wearedevelopers.com/magazine/115-mlops-deploying-maintaining-and-evolving-machine-learning-models-in-production) - [Dev Digest 138 - Are you secure about this?](https://www.wearedevelopers.com/magazine/486-dev-digest-138-are-you-secure-about-this) ## Related Jobs - [Senior Architect Realtime Bare-Metal Software](https://www.wearedevelopers.com/jobs/ext/381559-senior-architect-realtime-bare-metal-software) at **ZEISS Group** - [Machine Learning Engineer](https://www.wearedevelopers.com/jobs/ext/1597388-machine-learning-engineer) at **ZEISS Group** - [Backend Entwickler C#/.NET iv.)](https://www.wearedevelopers.com/jobs/ext/1262419-backend-entwickler-c-net-iv) at **Bosch-Gruppe Österreich** - [AI Software Engineer (Germany)](https://www.wearedevelopers.com/jobs/48317-ai-software-engineer-germany) at **Sunhat** - [Senior Software Engineer, Enterprise Products](https://www.wearedevelopers.com/jobs/ext/1841248-senior-software-engineer-enterprise-products) at **GitHub** - [Principal Software Engineer, Database Infrastructure](https://www.wearedevelopers.com/jobs/ext/1465908-principal-software-engineer-database-infrastructure) at **GitHub**