| Summary: | implementation of association generalization & properties redefinitions | ||
|---|---|---|---|
| Product: | [Modeling] MDT.UML2 | Reporter: | Javi <jfbriones_tech> |
| Component: | Core | Assignee: | Kenn Hussey <Kenn.Hussey> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | ed, Kenn.Hussey |
| Version: | 2.1.0 | Keywords: | plan |
| Target Milestone: | M7 | Flags: | Kenn.Hussey:
kepler+
|
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | Community Support | ||
|
Description
Javi
We would need to revisit how redefinition is supported for each of these use cases and determine what can be corrected and/or improved (doing so could be helpful in implementing changes for bug 297216). This could perhaps be done during the upcoming Keppler release cycle. Preliminary changes to support preservation and retrieval of redefinition details (lower bound, upper bound, and type) have been committed/pushed to the 'master' branch in git. These changes will be leveraged by fixes in code generation to follow after M6. I have committed/pushed changes to the 'master' branch in git which provide better code generation support for redefined types and multiplicities. With these changes, more specific type constraints are enforced in redefining classes and narrower multiplicities are enforced via overrides in the generated validator. All of the concerns in test case 1 are now addressed (and the same/similar issues in test case 2 are as well). I have also looked into the various combinations of derived and not derived and found that fields were only generated when expected (for supported combinations). Note that some combinations, e.g., where a derived property is redefined by a non-derived property or where one end of an association is derived while the other is not (which are considered unsupported) result in an invalid Ecore model for some test cases; in such cases, no code could be generated (obviously). Next, I'll be looking to round out test case 2 and see what, if anything, can be done about test case 3. Note that, since it's essentially a mix of test cases 1 and 2, it's questionable how easy it will be (or, indeed, whether it's even possible) to arrive at a code generation pattern which will properly capture the desired intent. I have committed/pushed changes to the 'master' branch in git which provide better codegen support for explicit redefinitions. With these changes, all of the concerns in test case 2 are now addressed. I also looked carefully at *set* and *isSet* methods and found eIsSet wasn't being correctly overridden to delegate to *isSet* methods for redefined features; this is now fixed. The better codegen support (for redefined types and multiplicities and for explicit redefinitions) for the issues in test cases 1 and 2 also help in test case 3. However, due the the "mixed" nature of test case 3, some methods (only two of them now) will still need to be implemented by hand. I'm afraid this is the best that can be done for now, especially since it's questionable whether such a case should even be supported. An integration build (for UML2 4.1) containing the changes is now available. Unfortunately these changes create nested EAnnotations that reveal a bug in EMF codegen. See Bug 411945. |