Presentation is loading. Please wait.

Presentation is loading. Please wait.

Towards Easier Data-Binding for Derived Values in Ecore-based Models

Similar presentations


Presentation on theme: "Towards Easier Data-Binding for Derived Values in Ecore-based Models"— Presentation transcript:

1 Towards Easier Data-Binding for Derived Values in Ecore-based Models
Dr. Bernhard Schätz Dr. Vincent Aravantinos Vadim Cebotari 1

2 Towards easier Data-binding for derived values in Ecore-based models
Motivation: Different views of the same model for different stakeholders Accounting Statistics Towards easier Data-binding for derived values in Ecore-based models 2 2

3 Towards easier Data-binding for derived values in Ecore-based models
Different views implies derived values Definition: Derived value Derived values are values of the model attributes that are computed from other model attributes. Application of derived values: allow to display different information for different stakeholders are not persisted in the model calculated and displayed in the views at runtime → avoidance of consistency problems in the model Towards easier Data-binding for derived values in Ecore-based models 3 3

4 Towards easier Data-binding for derived values in Ecore-based models
Example: Insurance contract Domain model: Insurance contract Derived value: Pro rata premium Pro rata premium = annual premium / payment Towards easier Data-binding for derived values in Ecore-based models 4

5 Towards easier Data-binding for derived values in Ecore-based models
Editable Derived values: Existing modeling tools do allow to define derived values, but these values are usually not easily changeable: you have to implement the reaction to change manually. This is particularly problematic because it contrasts with the viewing of (derived) values which is mostly automatized (e.g., in tools like Sirius). In many use cases editable derived values are a desired feature. The user does not care if the value is derived or not, s(h)e just want to modify it! Towards easier Data-binding for derived values in Ecore-based models 5 5

6 Towards easier Data-binding for derived values in Ecore-based models
What are the problems with derived values? Difficult to determine the implication on the model when modifying them Context- and domain-specific characteristics Manual implementation is required → Big effort required → Concrete consequence in practice: DERIVED VALUES ARE NON-CHANGEABLE What can we do? Assume the user modifies a derived value. How should the software react to it? → There is no all-purpose solution: it must be context- and domain-specific. We can nevertheless propose standard solution patterns: 'Warning': we let the user make any modification but display a warning if the modification yields inconsistencies in the view 'Rule': user modification entails automatic update of the model elements, according to some rule defined by the toolsmith 'Interaction': when attempting a modification, the user gets a dialog offering to modify the model elements of which the value derives Towards easier Data-binding for derived values in Ecore-based models 6 6

7 Towards easier Data-binding for derived values in Ecore-based models
Our solution: model-based approach for editing derived values IMPLEMENTATION Smart Data-Binding Tool (SmartDB Tool) Towards easier Data-binding for derived values in Ecore-based models 7

8 Towards easier Data-binding for derived values in Ecore-based models
Architecture of SmartDB Tool EMF Ecore SmartDB Metamodel Domain model SmartDB Model SmartDB View Towards easier Data-binding for derived values in Ecore-based models 8 8

9 Towards easier Data-binding for derived values in Ecore-based models
Using SmartDB Tool - Roles Towards easier Data-binding for derived values in Ecore-based models 9

10 Towards easier Data-binding for derived values in Ecore-based models
‘Warning‘ - Model-based definition Towards easier Data-binding for derived values in Ecore-based models 10

11 Towards easier Data-binding for derived values in Ecore-based models
‘Warning‘ – Editing of derived value User changes the receipt date to Towards easier Data-binding for derived values in Ecore-based models 11

12 Towards easier Data-binding for derived values in Ecore-based models
‘Warning‘ – Editing of derived value User wants to keep the change of the receipt date to Towards easier Data-binding for derived values in Ecore-based models 12

13 Towards easier Data-binding for derived values in Ecore-based models
‘Rule‘ - Model-based definition Model-based definition of the rule: Annual premium = pro rata premium * payment method The change of the derived attribute pro rata premium, computed as annual premium / payment method, will lead to the modification of the annual premium according to the above rule defined by the toolsmith. The payment method remains unchanged. Towards easier Data-binding for derived values in Ecore-based models 13

14 Towards easier Data-binding for derived values in Ecore-based models
‘Rule‘ – Editing of derived value View-based editing of derived value Rule for editing of derived value pro rata premium: Annual premium = pro rata premium * payment method Towards easier Data-binding for derived values in Ecore-based models 14

15 Towards easier Data-binding for derived values in Ecore-based models
‘Interaction‘ - Model-based definition Model-based definition of interaction: Tariff calculated premium should be adjusted Tariff calculated premium = tariff annual premium / (1.0 + risk premium rate) Risk premium rate should be adjusted Risk premium rate = (tariff annual premium / tariff calculated premium) – 1.0 By changing the derived attribute tariff annual premium, computed as tariff calculated premium * (1.0 + risk premium rate), the user can decide which of both attributes tariff calculated premium or risk premium rate should be adjusted according to the above formulas. The value of the other attribute should then be specified by the user in an interaction dialog. Towards easier Data-binding for derived values in Ecore-based models 15

16 Towards easier Data-binding for derived values in Ecore-based models
‘Interaction‘ – Editing of derived value The user wants to change the value of the derived attribute tariff annual premium to 1416,0 View-based editing of derived value Towards easier Data-binding for derived values in Ecore-based models 16

17 Towards easier Data-binding for derived values in Ecore-based models
‘Interaction‘ – Editing of derived value The user wants the risk premium rate to be adjusted to the new value of the tariff annual premium by setting tariff calculated premium to the value of 1200,0 Towards easier Data-binding for derived values in Ecore-based models 17

18 Towards easier Data-binding for derived values in Ecore-based models
‘Interaction‘ – Editing of derived value The new risk premium rate is calculated and displayed in the view. Towards easier Data-binding for derived values in Ecore-based models 18

19 Towards easier Data-binding for derived values in Ecore-based models
DEMO Towards easier Data-binding for derived values in Ecore-based models 19


Download ppt "Towards Easier Data-Binding for Derived Values in Ecore-based Models"

Similar presentations


Ads by Google