Faculty of Computer Science, Institute for Software- and Multimedia-Technology, Chair for Software Technology Matthias Bräuer and Birgit Demuth Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support Ocl4All: Modelling Systems with OCL Workshop at MoDELS 2007 Nashville, 30 Sept. 2007
Motivation DSLs OCL Standard Library Implementation Meta-Metamodels: Metamodel: Types Package • (E)MOF • Types M3 Integration contains • Ecore • Expres- JMI, sions • KM3 EMF Metamodels: OCL Expressions: Standard OCL Library Engine • UML • WFRs M2 Definition reference Model Code • CWM • Queries OCL JAVA • Custom • … OCL Engine: Standard OCL Models Library Engine • Interpreter M1 Execution uses Runtime Library • Code Gen- JAR erator. System: • Java M0 • DB • … Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 2
Motivation DSLs OCL Standard Library Implementation Meta-Metamodels: • (E)MOF M3 • Ecore • KM3 Metamodel: Types Metamodels: Package • Types • UML M2 Integration contains • Expres- • CWM JMI, sions • Custom EMF OCL Expressions: Models Standard OCL Library Engine • WFRs M1 Definition reference Model Code • Queries OCL JAVA • … ! OCL Engine: Standard OCL System: Library Engine • Interpreter • Java M0 Execution uses Runtime Library • Code Gen- • DB JAR erator. • … Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 3
Aims � integrate OCL • with arbitrary domain-specific languages • on different meta layers � detach OCL Standard Library from the language definition Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 4
Integrate OCL metamodel DSLs OCL Standard Library Implementation Meta-Metamodels: • (E)MOF M3 • Ecore • KM3 Metamodel: Types Metamodels: Package • Types • UML M2 Integration contains • Expres- • CWM JMI, sions • Custom EMF OCL Expressions: Models Standard OCL Library Engine • WFRs M1 Definition reference Model Code • Queries OCL JAVA • … OCL Engine: Standard OCL System: Library Engine • Interpreter • Java M0 Execution uses Runtime Library • Code Gen- • DB JAR erator. • … Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 5
Integrate OCL metamodel with a pivot model Dresden Kent OCL OCL TK EMF Library Common EMOF Ecore Bridge Model based on Pivot model based on depends on OCL Engine forward OCL MM DSL MM Adapters Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 6
Detach the standard library definition DSLs OCL Standard Library Implementation Meta-Metamodels: • (E)MOF M3 • Ecore • KM3 Metamodel: Types Metamodels: Package • Types • UML M2 Integration contains • Expres- • CWM JMI, sions • Custom EMF OCL Expressions: Models Standard OCL Library Engine • WFRs M1 Definition reference Model Code • Queries OCL JAVA • … OCL Engine: Standard OCL System: Library Engine • Interpreter • Java M0 Execution uses Runtime Library • Code Gen- • DB JAR erator. • … Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 7
OCL Standard Library as a pivot model instance Pivot OCL MM model instance instance of of instance instance of of serialize deserialize OCL Standard XMI Engine library file model Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 8
Modeling generics Generic � inspired by Ecore 2.3 types � core idea: make generics a first-class modeling construct: Type parameters Generic methods Type arguments Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 9
Binding generic types during parsing Collection<T> access read bind OCL OCL OclLibrary Generic OCL OCL interface Type expressions parser let c : Collection(String) in … getCollectionType(String) bindTypeParameter(T,String) Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 10
Open issues � modeling iterator expressions � binding of generic operations � coupling model and instance level � Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 11
Provide domain-specific execution semantics DSLs OCL Standard Library Implementation Meta-Metamodels: • (E)MOF M3 • Ecore • KM3 Metamodel: Types Metamodels: Package • Types • UML M2 Integration contains • Expres- • CWM JMI, sions • Custom EMF OCL Expressions: Models Standard OCL Library Engine • WFRs M1 Definition reference Model Code • Queries OCL JAVA • … OCL Engine: Standard OCL System: Library Engine • Interpreter • Java M0 Execution uses Runtime Library • Code Gen- • DB JAR erator. • … Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 12
The end � Thank you for your attention! � Questions, comments? Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 13
Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 14
Pivot model overview Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 15
Generics meta model Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 16
Generic types Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 17
The OclLibrary interface Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support 18
Recommend
More recommend