Treffer: Root Contracting: A Novel Method and Utility for Implementing Design by Contract in Domain-Driven Design with Event Sourcing.

Title:
Root Contracting: A Novel Method and Utility for Implementing Design by Contract in Domain-Driven Design with Event Sourcing.
Source:
Electronics (2079-9292); Nov2025, Vol. 14 Issue 21, p4205, 25p
Database:
Complementary Index

Weitere Informationen

Event-Sourced Systems (ESSs) that adopt Domain-Driven Design (DDD) are becoming more popular because of their intuitive business process modeling and improved auditability, scalability, and flexibility. However, ensuring the correctness of domain models—particularly event-sourced aggregates (ESAs)—remains challenging. To address this, we propose root contracting, a novel, constrained, and lightweight adaptation of Design by Contract (DbC), specifying the precondition, postcondition, and class invariant exclusively at aggregate roots. Root contracting simplifies correctness enforcement by leveraging DDD principles aligned with DbC and the standardized ESA code structure. We offer uContract, a Java open-source utility that realizes root contracting, enabling automated verification of ESAs with configurable runtime overhead. Through performance evaluation and methodological discussion, we demonstrate that root contracting effectively bridges formal correctness with practical domain modeling. Our approach provides developers with a tool to streamline development workflows, potentially reducing testing overhead and supporting integration with methodologies like Behavior-Driven Development (BDD). [ABSTRACT FROM AUTHOR]

Copyright of Electronics (2079-9292) is the property of MDPI and its content may not be copied or emailed to multiple sites without the copyright holder's express written permission. Additionally, content may not be used with any artificial intelligence tools or machine learning technologies. However, users may print, download, or email articles for individual use. This abstract may be abridged. No warranty is given about the accuracy of the copy. Users should refer to the original published version of the material for the full abstract. (Copyright applies to all Abstracts.)