Enforcing Derived Union Constraints in EMF Code Generation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current software development tools, such as the Eclipse Modeling Framework (EMF), lack the ability to generate Java code that enforces derived union constraints, which are essential for maintaining the integrity of software models, leading to the discarding of critical constraint information during code generation.
Innovation Solution
A mechanism is introduced to track and interpret derived union constraints from model elements, using annotations to record constraint information, which is then used to generate Java code that enforces these constraints, ensuring that derived union properties are maintained and enforced in the target code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If EMF is used to generate Java code from Rose model, then code generation capability is provided, but derived union constraint information is discarded
Solution Approach 1:
The patent applies preliminary action by processing derived union constraints before code generation occurs. The system tracks constraint information from model elements and prepares constraint enforcement mechanisms in advance, ensuring that constraint data is preserved and integrated into the code generation process rather than discarded during the transformation from Rose model to Java code.
Solution Approach 2:
The patent introduces an intermediary mechanism that acts as a bridge between the Rose model and Java code generation. This intermediary system tracks derived union constraints and translates them into enforceable Java code structures, preventing information loss during the code generation process while maintaining the integrity of constraint specifications.
2Loss of information
If derived union properties are retained in EMF, then constraint information is preserved, but constraint enforcement capability is lost
Solution Approach 1:
The patent applies self-service by enabling the generated Java code to automatically enforce derived union constraints without requiring external intervention. The system generates self-verifying code that inherently ensures constraint compliance through its structure, allowing the code to serve itself in maintaining model integrity rather than requiring separate enforcement mechanisms.
Solution Approach 2:
The patent implements feedback mechanisms that provide constraint verification during code execution. The generated Java code includes feedback loops and validation logic that monitor whether derived union constraints are satisfied, allowing the system to detect and report constraint violations while maintaining the ability to enforce these constraints throughout the software lifecycle.
Data Source
AI summary
A computer method and system preserves derived union constraints and enforces the same in generated target code. The method includes (a) providing a model element having one or more derived union properties, (b) tracking derived union constraints from the derived union properties of the model element, and (c) interpreting the tracked derived union constraints and generating therefrom an implemenation that enforces the derived union constraint. Tracking may be by annotating the model element accordingly.


