Round-trip Engineering for Tactical DDD: A Constraint-Based Vision for the Masses
Despite Domain-Driven Design's proven value in managing complex business logic, a fundamental semantic expressiveness gap persists between generic modeling languages and tactical DDD patterns, causing continuous divergence between design intent and i…
Authors: Weixing Zhang, Mario Herb, Martin Armbruster
Round-trip Engineering for T actical DDD: A Constraint-Based Vision for the Masses W eixing Zhang Karlsruhe Institute of T echnology Karlsruhe, Germany weixing.zhang@kit.edu Mario Herb esentri A G Karlsruhe, Germany mario.herb@esentri.com Martin Armbruster Karlsruhe Institute of T echnology Karlsruhe, Germany martin.armbruster@kit.edu Bowen Jiang Karlsruhe Institute of T echnology Karlsruhe, Germany bowen.jiang@kit.edu Marcel Vielsack esentri A G Karlsruhe, Germany marcel.vielsack@esentri.com Anne Koziolek Karlsruhe Institute of T echnology Karlsruhe, Germany koziolek@kit.edu This is a preprint of a paper accepted at FSE 2026 (A CM International Conference on the Foundations of Software En- gineering). The nal version will appear in the ACM Digital Library . Abstract Despite Domain-Driven Design’s pro ven value in managing com- plex business logic, a fundamental semantic expressiveness gap persists b etween generic modeling languages and tactical DDD patterns, causing continuous div ergence between design intent and implementation. W e envision a constraint-based tactical modeling environment that transforms abstract architectural principles into explicit, tool-enforced engineering constraints. At its core is a DDD- native metamodel where tactical patterns are rst-class modeling primitives, coupled with a real-time constraint verication engine that prevents architectural violations during mo deling, and bidi- rectional synchronization mechanisms that maintain model-co de consistency thr ough round-trip engineering. This approach aims to democratize tactical DDD by emb edding expert-level architectural knowledge directly into modeling constraints, enabling small teams and junior developers to build complex business systems without sacricing long-term maintainability . By lowering the technical barriers to DDD adoption, we envision transforming tactical DDD from an elite practice requiring continuous expert oversight into an accessible engineering discipline with tool-supporte d verication. CCS Concepts • Do Not Use This Code → Generate the Correct T erms for Y our Paper ; Generate the Correct T erms for Y our Pap er ; Generate the Correct T erms for Y our Paper; Generate the Correct T erms for Y our Paper . Ke ywords T actical Domain-Driven Design, Semantic Modeling, Constraint- Based Engineering, Model-Code Consistency , Round-trip Engineer- ing A CM Reference Format: W eixing Zhang, Mario Herb, Martin Armbruster , Bowen Jiang, Marcel Viel- sack, and Anne K oziolek. 2026. Round-trip Engineering for T actical DDD: A Constraint-Based Vision for the Masses. In Proceedings of ACM International Conference on the Foundations of Software Engineering (Conference FSE’26) . A CM, New Y ork, NY , USA, 5 pages. https://doi.org/10.1145/3803437.3805566 1 Introduction Domain-Driven Design (DDD) [ 5 ], since its introduction in 2003, has become an established methodology for managing complex business logic. However , the practice of tactical DDD still faces inadequate tool supp ort. A recent systematic literature review [ 17 ] that analyzed 36 pe er-review ed studies identied the persistent “model-code gap” as a primar y technical challenge in DDD adop- tion: domain models frequently diverge from their co de implemen- tations [ 24 ][ 25 ], undermining the core promise of DDD to maintain alignment between domain understanding and software structure. The root cause of this problem lies in the insucient semantic expressiveness of existing modeling tools. Neither generic UML tools nor co de-rst frameworks can adequately encode the semantic constraints of DDD patterns, resulting in model validation relying on manual review rather than tool enforcement [ 17 ]. This tool-level deciency is a signicant contributor to the model-code gap. W e propose a constraint-based round-trip engineering environ- ment that elevates tactical DDD patterns to rst-class citizens of the modeling language, rather than auxiliary annotations to UML. In this environment, A ggregate Root , Entity , and V alue Obje ct are no longer class diagram stereotypes that must be manually main- tained, but modeling primitives with built-in semantic constraints. For example, when modeling an aggregate , if a developer attempts to have an entity directly reference an entity from another aggre- gate —which violates aggregate b oundary rules—the verication engine will imme diately reject this op eration at modeling time and suggest using an identier V alue Obje ct instead. By encoding expert-level architectural knowledge as tool-enforced constraints, this vision aims to low er the barrier to tactical DDD, enabling small teams and junior developers to build complex business systems without sacricing long-term maintainability . 2 Gap Analysis: The Semantic Decit in DDD T ooling The practice of tactical DDD faces a structural dilemma in tool sup- port. Existing solutions can b e categorized into several approaches: Generic UML tools exhibit insucient semantic expressiveness. T ools such as Enterprise Architect and Visual Paradigm repre- sent DDD patterns— Aggregate Root , Entity , V alue Object —as stereo- types on class diagrams, which are essentially metadata annota- tions [ 17 ]. This approach cannot encode the semantic constraints Conference FSE’26, July 05–09, 2026, Montréal, QC, Canada Zhang et al. of patterns [ 11 , 18 ]. For example, tools cannot pr event developers from placing Entity classes outside their owning aggregates , nor can they enforce the immutability of V alue Obje ct [ 7 , 15 ]. Core DDD rules, such as Aggregate b oundary integrity che cks and Entity life- cycle dependency validation, cannot be automatically veried by tools at modeling time. While tools like JQAssistant [ 8 ] can check some DDD rules at compile time, such checks operate at the code level rather than during modeling, and current implementations cover only a subset of possible constraints. Most violations are still discovered during code revie w or at runtime. Pure code-rst frameworks lack model views. Frameworks such as JMolecules [ 21 ] annotate the DDD roles of classes through marker interfaces or annotations, providing partial constraint checking at compile time. However , such solutions have two fundamental deciencies: rst, the absence of visual models prevents domain experts from participating in modeling discussions—domain ex- perts typically do not read code [ 9 ], yet core DDD practices such as EventStorming [ 2 ] and Context Mapping [ 5 ] depend on shared visual artifacts; se cond, mo del evolution tracking relies on code commit history , lacking a systematic overview of high-level archi- tectural changes such as Bounded Contexts and A ggregate struc- tures [ 3 ]. Strategic alignment alone is insucient. Practitioners have also attempted to reduce DDD’s reliance on e xpert judgment through strategic-level guidance—for example , using bounded contexts to dene microservice boundaries [ 26 ]. Howev er , such alignment can- not prevent tactical violations: aggregate boundaries can still be breached and domain invariants compromised within correctly bounded ser vices [ 26 ]. In summar y , existing tools do not treat DDD patterns as rst- class citizens of the modeling language - none is spe cically de- signed for DDD’s tactical patterns [ 12 , 19 ]. 3 Vision: DDD-Native Round-trip Engine ering W e propose a constraint-based tactical mo deling environment real- ized through four components: 1) the Domain Modeler provides a graphical modeling interface based on a native DDD metamodel; 2) the Domain Model V erier performs real-time constraint check- ing and oers intelligent repair suggestions, recent advances in GenAI also show potential for enhancing automated repair sugges- tions [ 14 ][ 13 ]; 3) the Domain Code Generator enables model-to- code incremental synchronization; 4) the code-to-model direction leverages the e xisting Domain Mirror component [ 4 ]. T ogether , these transform DDD semantic rules fr om implicit expert knowl- edge into tool-enforced constraints. The Domain Modeler provides a graphical modeling interface with real-time visual feedback, aligned with the vision of metamodel-based language workbenches [ 23 ]. 3.1 Metamodel Hierarchy In contrast to mapping DDD patterns to generic UML metaclasses, we propose a native DDD metamodel in which the containment relationships and dep endency rules among tactical patterns are explicitly encoded as metamodel hierarchies. Specically: Aggre- gate is the top-level modeling unit that maintains internal con- sistency through Aggr egateRoot as the sole entry point, explicitly containing Entity and V alueObje ct ; Entity possesses unique identity and lifecycle, while V alueObject denes equality through attributes and is immutable; DomainEvent is published by Aggregate to cap- ture facts about aggregate state changes. This metamodel structure inherently prohibits cross-aggregate entity references, i.e., inter- aggregate associations can only be realized through V alueObject - typed identiers. Additionally , the metamodel includes Repositor y and DomainService as architectural conne ctors: Repositor y abstracts the persistence access of Aggregates with a one-to-one correspon- dence to A ggregates ; DomainSer vice encapsulates domain logic that does not naturally belong to a single Entity or V alueObject [ 5 ]. These elements, together with the core tactical patterns, constitute a complete DDD metamodel that enables constraint verication to cover the entire spectrum from domain modeling to architectural organization. 3.2 Constraint V erication and Intelligent Guidance Based on the ab ove metamodel, we identify two types of DDD semantic constraints: (1) structural constraints that spe cify legal composition relationships among patterns (e .g., value objects can- not contain entity references); (2) behavioral constraints that specify the operational semantics and state evolution rules of patterns, to the extent decidable by static analysis (e.g., aggregate root methods are the sole entry point for modifying internal aggregate state). The verication engine checks these constraints in real-time during modeling operations and provides contextualized repair sugges- tions. For example, when a developer attempts to dene a pub- lic setter method on an Entity that allows external modication of aggregate state bypassing the AggregateRoot , the b ehavioral constraint verier ags this violation and suggests encapsulating the state change within an A ggregateRoot method. This tool-level intelligent guidance emb eds DDD expert architectural de cision knowledge into the modeling workow , enabling junior developers to naturally acquire tactical DDD b est practices. Unlike existing constraint-based approaches that focus on post-hoc validation or pattern-based detection of violations [ 6 ], our approach embeds tac- tical DDD constraints directly into both the modeling language’s metamodel and the tool’s verication engine, supporting contin- uous validation during model evolution. While our curr ent repair suggestions are rule-base d, recent w ork on LLM-based co-evolution of DSL denitions and instances [ 22 ] suggests potential for more adaptive, context-awar e guidance in future iterations. 3.3 Bidirectional Synchronization Me chanism T o bridge the gap b etween model and code, we adopt a bidirec- tional synchronization strategy . In the co de-to-model direction, we leverage the existing Domain Mirror component [ 4 ], which uses reection (specically the Java Ree ction API) to transfer meta- information from co de to the mo del level. In the model-to-co de direction, the Domain Code Generator to be developed will be in- spired by the Vitruvius framework [ 10 ], a view-based approach for consistency preservation in model-driven development, to main- tain view consistency through incremental model transformations. Specically , model changes will be captured by a delta domain Round-trip Engineering for T actical DDD: A Constraint-Based Vision for the Masses Conference FSE’26, July 05–09, 2026, Montréal, QC, Canada metamodel and translated into corresponding code modications through declarative transformation rules. 4 Ke y Research Challenges Realizing the above vision requires systematically addressing the following core challenges: 4.1 Challenge 1: Balancing Completeness and Practicality of DDD Constraint Rules T actical DDD patterns contain well-dened semantic constraints, but there is currently a lack of systematic resear ch on how to trans- late these constraints into tool-level verication rules. DDD’s core rules such as “entities cannot reference across aggregate bound- aries” and “value objects must be immutable” can be enforced as hard constraints, howev er , DDD practice requires consideration of additional factors, including design recommendations proposed by the DDD community (such as V ernon’s “design small aggr egates” principle [ 20 ]) and engineering trade-os (such as performance opti- mization and legacy compatibility) that depend on specic contexts. The challenge is designing a tool that ensures semantic rigor with- out be coming an obstacle to real-world projects. One pragmatic approach is to allow developers to override sp ecic constraints with documented justications, or to disable certain constraints for specic projects. 4.2 Challenge 2: Incremental Delta Identication and Propagation The primar y challenge of incremental synchronization is identi- fying mo del changes. When developers add a new value object attribute to an aggregate, the system must distinguish between an incremental modication and a scenario requiring complete code regeneration. A naive approach would be full r egeneration, but this risks of overwriting manually added business logic. DDD patterns make this harder: dependencies exist among patterns, and changes to a single element may violate aggregate boundaries or consistency rules. T o address this and in building on the mapping of software architecture models to source code using Vitruvius [ 16 ], we plan to dene a delta metamodel that explicitly expresses the semantics of model changes, coupled with declarative transformation rules to enable precise mapping from models to code. 4.3 Challenge 3: Round-trip Implementation Round-trip engineering includes two directions: the model-to-co de direction (discussed in Section 4.2 ) and the code-to-mo del direc- tion, which is realized through the existing Domain Mirror com- ponent [ 4 ] that uses Java Reection API to transfer co de structure information to the model level. The key challenge is the consistency guarantee between the two directions, i.e., the structure assump- tions when the Domain Code Generator generates code must match the identication logic when the Domain Mirror does reection. For example, when Domain Code Generator generates an entity class, it assumes the class contains an identier eld, and Domain Mirr or must also b e able to recognize the correspondence between this eld and the entity identier in the model when doing r eection; if developers manually r ename or delete this eld, the round-trip synchronization will cause inconsistency between the model and code. This consistency challenge extends b eyond DDD-specic tool- ing; maintaining coherent relationships among software artifacts, running systems, and models is a br oader concern in continuous software development [ 1 ]. 5 Research Roadmap Based on the components and challenges mentione d ab ove, our Research Roadmap will include the following ve phases (Figure 1 ): 5.1 Phase 1: Metamodel and Initial Modeling W e will formalize tactical DDD elements into a metamodel that ac- curately represents core concepts such as Aggregates, Entities, and V alue Objects. Based on this metamodel, we will develop the Do- main Modeler component with its visualization capabilities, along with a repository for persisting domain mo dels. 5.2 Phase 2: Code Generation W e will develop the initial Domain Code Generator component, which enables the generation of a source co de representation of a given domain model. Building on the Vitruvius frame work [ 10 ], we primarily target Java, with other languages to be explored and developed. 5.3 Phase 3: Constraint V erication Based on existing literatur e and a literature search, we will identify and formally dene the DDD constraint rules, addressing chal- lenge 1 in the process. The resulting constraints will be included in the developed Domain Mo del V erier component, which che cks the constraints and suggests possibilities for repairing constraint violations. 5.4 Phase 4: Incremental and Round-trip Synchronization W e will enhance the Domain Modeler and Domain Code Generator with incremental and round-trip synchronization, addressing chal- lenges 2 and 3. This involves specifying a delta domain metamodel to express DDD-typical changes, enabling incremental model-to- code transformations that modify only aected co de portions. The code-to-model direction leverages the existing Domain Mirr or com- ponent [ 4 ]. 5.5 Phase 5: Empirical V alidation Finally , we plan to empirically evaluate and validate the developed components, as outlined in the next section. 6 Evaluation Strategy W e plan a three-layered evaluation strategy for validation. Constraint mechanism eectiveness. W e construct a test suite containing DDD constraint violations identied in [ 17 ], such as cross-aggregate entity references, value object mutability viola- tions, and aggregate boundary leaks. W e measure constraint rule coverage, precision/recall rates, and whether repair suggestions are semantically correct (veried through e xpert review ). Conference FSE’26, July 05–09, 2026, Montréal, QC, Canada Zhang et al. Phase 1: Metamodel & Initial Modeling Tactical DDD Metamodels Pha se 2: Code Genera tion Domain Code Generator Pha se 3: Constra int Verica tion Formal DDD Constraint Rules Domain Model Verier Pha se 4: Incrementa l & Round-trip Sync Delta Domain Metamodel Delta Domain Modeler I ncremental Model-to-Code Trans f ormation Domain Mirror (Code-to-Model) extend evaluate Pha se 5: Empirica l Va lida tion Usability & Productivity DDD Constraint Violation Test Suite Round-trip Synchronization Test Model-to-Code ( JA V A ) Trans f ormation Domain Modeler & Repository Figure 1: Over view of Research Roadmap Round-trip synchronization quality . Controlled experiments will test whether incremental synchronization preserves semantic equiv- alence after model changes, prev ents overwriting of manually writ- ten business logic, and maintains model-code consistency through multiple round-trips. Usability and productivity . W e conduct comparative studies where junior and senior developers complete the same mo deling tasks us- ing traditional UML tools versus the constraint-base d DDD model- ing environment. W e e valuate modeling time, task quality (assessed through expert re view), and the rate of ar chitectural violations in the resulting models. The hyp othesis is that constraint guidance will bring junior developers’ modeling quality closer to the senior level. Additionally , preliminary case studies with industry partners will assess whether the tool ts into real dev elopment workows and whether teams nd the constraint enforcement helpful or re- strictive. 7 Discussion: Impact and Limitations Our Vision will have an impact on two lev els. First, at the engineer- ing practice and metho dology level, the constraint-driv en modeling environment can lo wer the entry barrier to tactical DDD—junior de- velopers do not need to master all architectural principles of classic tactical DDD fully , but can avoid deviating from tactical DDD rules through tool-enforced constraints. This enables small teams to build complex business systems without relying on continuous expert review , essentially transforming DDD from an experience-driven practice into a tool-veriable engineering discipline. Second, at the software engineering research lev el, this research will pro vide an empirical case for constraint-driven domain-specic modeling, with methodological relevance to mo del-driven engineering and domain-specic language research. This vision has four limitations. First, it focuses on the Java ecosystem and may not apply to other languages. Se cond, the vision focuses on tactical DDD patterns and does not cover strategic-level bounded context modeling. Third, the to ol enforces DDD rules but does not teach DDD concepts. T eams still need a basic understand- ing of domain modeling. Fourth, practical adoption depends on seamless integration between modeling and co ding environments; if developers perceive friction, the y may bypass the modeling layer entirely . References [1] Martin Armbruster, Manar Mazkatli, and Anne Koziolek. 2025. A process for continuous consistency-aware quality management. (2025). [2] Alberto Brandolini. 2018. Introducing EventStorming: A n act of Delib erate Collective Learning . Leanpub. https://leanpub.com/intr oducing_eventstorming [3] Susanne Braun, Stefan Deßloch, Eberhard W ol, Frank Elberzhager , and Andreas Jedlitschka. 2021. Tackling consistency-related design challenges of distributed data-intensive systems: An action research study . In Procee dings of the 15th ACM/IEEE International Symposium on Empirical Software Engineering and Mea- surement (ESEM) . 1–11. [4] esentri A G. 2024. Domain Mirror. Retrieved September 2025 fr om https://github. com/esentri/domainlifecycles/tree/main/mirror [5] Eric Evans. 2004. Domain-driven design: tackling complexity in the heart of software . Addison- W esley Professional. [6] Sebastian Herwig. [n. d.]. Pattern Matching in Conceptual Modes-A Formal Multi-Modelling Language Approach. ([n. d.]). [7] Benjamin Hippchen, Pascal Giessler , Roland Steinegger , Michael Schneider , and Sebastian Abeck. 2017. Designing microservice-based applications by using a domain-driven design approach. International Journal on Advances in Software 10, 3&4 (2017), 432–445. [8] jqassistant. 2025. jQAssistant. https://github.com/jqassistant . Accessed: 2026-01- 22. [9] Stefan Kapferer and Olaf Zimmermann. 2020. Domain-driven service design: Context modeling, model r efactoring and contract generation. In Symposium and Summer School on Service-Oriented Computing . Springer , 189–208. [10] Heiko Klare, Max E Kramer , Michael Langhammer , Dominik W erle, Erik Burger , and Ralf Reussner . 2021. Enabling consistency in view-based system devel- opment—the vitruvius approach. Journal of Systems and Software 171 (2021), 110815. [11] Duc Minh Le, Duc-Hanh Dang, and Viet-Ha Nguy en. 2018. On domain driven design using annotation-based domain specic language. Computer Languages, Round-trip Engineering for T actical DDD: A Constraint-Based Vision for the Masses Conference FSE’26, July 05–09, 2026, Montréal, QC, Canada Systems & Structures 54 (2018), 199–235. [12] Duc Minh Le, Duc-Hanh Dang, and Ha Thanh Vu. 2019. jDomainApp: a module- based domain-driven software framework. In Proceedings of the 10th International Symposium on Information and Communication T echnology . 399–406. [13] Jialong Li, Mingyue Zhang, Nianyu Li, Danny W eyns, Zhi Jin, and Kenji T ei. 2024. Exploring the Potential of Large Language Models in Self-adaptive Systems. In Proceedings of the 19th International Symposium on Software Engineering for Adaptive and Self-Managing Systems . 77–83. doi:10.1145/3643915.3644088 [14] Jialong Li, Mingyue Zhang, Nianyu Li, Danny W eyns, Zhi Jin, and Kenji T ei. 2024. Generative AI for Self-Adaptiv e Systems: State of the Art and Research Roadmap . ACM Transactions on Autonomous and Adaptive Systems 19, 3, Article 13 (Sept. 2024), 60 pages. doi:10.1145/3686803 [15] Gururaj Maddodi, Slinger Jansen, and Michiel Overeem. 2020. Aggregate architec- ture simulation in event-sourcing applications using layer ed queuing networks. In Proceedings of the ACM/SPEC International Conference on Performance Engi- neering . 238–245. [16] Manar Mazkatli, David Monschein, Martin Armbruster, Robert Heinrich, and Anne Koziolek. 2025. Continuous integration of architectural performance mod- els with parametric dependencies–the CIPM approach. Automated Software Engineering 32, 2 (2025), 54. [17] Ozan Özkan, Önder Babur , and Mark van den Brand. 2025. Domain-Driven Design in software development: A systematic literature review on implementation, challenges, and eectiveness. Journal of Systems and Software (2025), 112537. [18] José Roberto C Perillo , Eduardo M Guerra, and Clovis T Fernandes. 2009. Daileon: a tool for enabling domain annotations. In Proceedings of the W orkshop on AOP and Meta-Data for Software Evolution . 1–4. [19] Monique Sno eck and Yves W autelet. 2022. Agile MERODE: a model-driven software engineering method for user-centric and value-base d development. Software and Systems Modeling 21, 4 (2022), 1469–1494. [20] V aughn V ernon. 2013. Implementing domain-driven design . Addison- W esley . [21] xMolecules. 2020. JMolecules Project. Retrieved November 2025 from https: //github.com/xmolecules/jmolecules Accessed November , 2025. [22] W eixing Zhang, Bowen Jiang, Yuhong Fu, Anne Koziolek, Regina Hebig, and Daniel Strüber. 2026. Leveraging LLMs to support co-evolution between de- nitions and instances of textual DSLs: A Systematic Evaluation. arXiv preprint arXiv:2602.11904 (2026). [23] W eixing Zhang, Jan-Philipp Steghöfer , Regina Hebig, and Daniel Strüber . 2023. A rapid prototyping language workbench for textual DSLs based on Xtext: Vision and progress. arXiv preprint arXiv:2309.04347 (2023). [24] W enli Zhang, W eixing Zhang, Daniel Strüber , and Regina Hebig. 2023. Manual abstraction in the wild: A multiple-case study on oss systems’ class diagrams and implementations. In 2023 ACM/IEEE 26th International Conference on Model Driven Engineering Languages and Systems (MODELS) . IEEE, 36–46. [25] W enli Zhang, W eixing Zhang, Daniel Strüber , and Regina Hebig. 2025. An empirical study of manual abstraction between class diagrams and code of open- source systems. Software and Systems Mo deling 24, 6 (2025), 1797–1823. [26] Chenxing Zhong, Shanshan Li, Huang Huang, Xiaodong Liu, Zhikun Chen, Yi Zhang, and He Zhang. 2024. Domain-driven design for microservices: An evidence-based investigation. IEEE Transactions on Software Engineering 50, 6 (2024), 1425–1449. Received 22 January 2026; accepted 17 March 2026
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment