Bug 537390 - Add Segments to the DMR
Summary: Add Segments to the DMR
Status: RESOLVED FIXED
Alias: None
Product: ECP
Classification: Modeling
Component: EMF Forms (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.19.0   Edit
Assignee: Lucas Koehler CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy
Depends on:
Blocks:
 
Reported: 2018-07-25 12:13 EDT by Lucas Koehler CLA
Modified: 2018-12-12 11:06 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Koehler CLA 2018-07-25 12:13:53 EDT
Besides the current way DMRs are defined, a DMR should also have a list of segments that can be resolved against a root domain object.
Comment 1 Eclipse Genie CLA 2018-07-25 12:16:25 EDT
New Gerrit change created: https://git.eclipse.org/r/126619
Comment 2 Eclipse Genie CLA 2018-08-23 10:09:30 EDT
New Gerrit change created: https://git.eclipse.org/r/127933
Comment 3 Eclipse Genie CLA 2018-08-23 10:09:32 EDT
New Gerrit change created: https://git.eclipse.org/r/127932
Comment 4 Eclipse Genie CLA 2018-08-24 11:30:15 EDT
New Gerrit change created: https://git.eclipse.org/r/128044
Comment 5 Eclipse Genie CLA 2018-08-24 11:30:17 EDT
New Gerrit change created: https://git.eclipse.org/r/128043
Comment 6 Eclipse Genie CLA 2018-08-24 11:30:18 EDT
New Gerrit change created: https://git.eclipse.org/r/128042
Comment 7 Eclipse Genie CLA 2018-09-24 06:37:42 EDT
New Gerrit change created: https://git.eclipse.org/r/129860
Comment 11 Eclipse Genie CLA 2018-09-26 10:25:18 EDT
New Gerrit change created: https://git.eclipse.org/r/130018
Comment 12 Eclipse Genie CLA 2018-09-27 11:22:18 EDT
New Gerrit change created: https://git.eclipse.org/r/130080
Comment 16 Eclipse Genie CLA 2018-10-16 09:10:01 EDT
New Gerrit change created: https://git.eclipse.org/r/130981
Comment 17 Eclipse Genie CLA 2018-10-16 09:10:03 EDT
New Gerrit change created: https://git.eclipse.org/r/130980
Comment 21 Eclipse Genie CLA 2018-10-26 08:52:49 EDT
New Gerrit change created: https://git.eclipse.org/r/131508
Comment 26 Eclipse Genie CLA 2018-10-30 13:35:03 EDT
New Gerrit change created: https://git.eclipse.org/r/131669
Comment 28 Eclipse Genie CLA 2018-11-16 07:02:12 EST
New Gerrit change created: https://git.eclipse.org/r/132558
Comment 30 Eclipse Genie CLA 2018-11-19 17:44:20 EST
New Gerrit change created: https://git.eclipse.org/r/132719
Comment 32 Lucas Koehler CLA 2018-12-11 10:17:44 EST
Domain model references can now also contain a list of segments which is used to resolve a feature in the domain data.
EMF Forms support on-the-fly conversion of the old DMRs during runtime. This allows testing EMF Forms's stability using segments without the need to change existing view model files. By default, this conversion is turned OFF. It can be enabled by setting the runtime parameter:
-enableSegmentGeneration

DMRs with segments do not yet support the full feature set of EMF Forms. Currently open features to implement are tracked in these follow up issues:
Bug 542669 - [Segments] Extend view model tooling for segments
Bug 542670 - [Segments] Extend view template model tooling for segments
Bug 542671 - [Segments] Adapt the view template's DMR selectors to segments
Bug 542672 - [Segments] Adapt ViewValidator to segments

A final migration of legacy DMRs to segment based DMRs is tracked in
Bug 542673 - [Segments] Provide migration with persistence from legacy DMRs to segments
Comment 33 Lucas Koehler CLA 2018-12-12 11:06:00 EST
The implementation of domain model reference segments introduces a new way of configuring the path of a domain model reference.

To understand the difference, I shortly elaborate on the current domain model reference based approach. Currently, special behavior like using an index on a multi-reference, or defining a table is achieved by using a specialized domain model reference. Thereby, these references typically contain further child references to describe the path to the feature which is treated special. E.g. an index dmr has a prefix dmr, an index and a target dmr. The prefix dmr describes the path to the indexed feature and the target dmr the path from the resolved object of the indexed feature. This approach is quite impractical when multiple special features (e.g. multiple indexings) need to be combined in one domain model reference.
Furthermore, the current domain model reference approach is coupled to the structural feature mechanism of EMF.

In order to get rid of the problem of cascaded domain model references and move in the direction of a data framework independent approach, we introduce the concept of segments. Thereby, a domain model reference only contains a list of segments. The special behavior is encapsulated in single segments. As a consequence, various special features can be mix and matched in ONE domain model reference by using corresponding segments. Furthermore, the segments don’t have a dependency on EMF anymore. Instead, features are stored based on their name. In context with the root EClass of a domain model reference, they can then be resolved because a feature name is unique for an EClass.

Because the change from different domain model references to only a domain model reference that contains various segments is not a trivial migration, we implement a hybrid solution. This allows a gradual migration to the new segment mechanism.
This means, current view models can still be used and created as usual. In addition, we introduce a runtime parameter which enables on-the-fly runtime conversion of all domain model references to segments. Thereby, generated segments are not persisted but only used at runtime. As a consequence, enabling the parameter allows risk-free testing of the new mechanism at runtime: If something does not work, the parameter can simply be removed. To make this work, we adapted EMF Forms’s core services to be able to handle the standard domain model references as well as segment based references. If segments are present, the segment based approach is used.

The runtime generation of segments can be activated with the program argument:
-enableSegmentGeneration

Please feel free to activate the segment generation and report any bugs you might encounter.