| Summary: | [Flock] Rule re-use for subtypes in original metamodel | ||
|---|---|---|---|
| Product: | [Modeling] Epsilon | Reporter: | Louis Rose <louis> |
| Component: | Core | Assignee: | Louis Rose <louis> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | interim | ||
I could think of two solutions (there are probably more):
- add abstract rules and an extends keyword to rules
- separate "retyping" (to part of rules) and rule application (to allow rules to be executed on abstract types)
I preferred the latter approach because it adds fewer new concepts to the language, and (presuming that migration logic is often similar for subtypes) should yield more concise migration strategies than the former. With the former approach, it would have been possible to re-use migration logic from types outside of the inheritance hierarchy, but I don't anticipate much demand for this.
Now, the above migration strategy is written:
migrate DiagramElement {
migrated.figure := original.figure.length();
}
migrate DiagramLabel {
migrated.accessor := original.accessor.length();
}
Checked into SVN. Assigning to Dimitris for build integration; thanks! This was fixed no later than interim build 0.9.0.201104180016. Fixed in 0.9.1 |
Presently, Flock rules cannot be specified on abstract types, which limits re-use. The following strategy (for GMF Graph) exhibits duplication because of this: // Compartment, Connection, Node and DiagramLabel are subtypes of the abstract class DiagramElement migrate Compartment { migrated.figure := original.figure.length(); } migrate Connection { migrated.figure := original.figure.length(); } migrate DiagramLabel { migrated.figure := original.figure.length(); migrated.accessor := original.accessor.length(); } migrate Node { migrated.figure := original.figure.length(); }