ReOCL: An Incremental OCL Core for Reactive Web-Based Modeling
Abstract
Constraint languages such as OCL are commonly used to add precision to domain models and meta-models, typically built using UML class diagrams and Ecore, respectively. However, current constraint languages and their tooling are poorly aligned with modern web-based modeling stacks, which demand reactive execution environments that immediately respond to user interactions. To address this gap, this paper presents ReOCL, a restricted OCL core designed for incremental, reactive constraint validation for the web. ReOCL defines a compilation strategy that maps invariants into reactive signals —like those found in Angular or Preact— to immediately update invariant status upon user changes. The approach relies on delta-based incremental maintenance of collection views, at constant cost per element added or removed, and on transactions that can be committed or rolled back to support @pre handling. We present a formalization of ReOCL and a TypeScript implementation. We evaluate our approach against adjacent constraint checking web frameworks, showing that ReOCL trades OCL expressiveness for update costs that stay constant, not linear, as models grow, gaining orders of magnitude on large incremental workloads.