Community
Participate
Working Groups
2.2 M5 Examples The "Convert to Metamodel" action contributed to the UML2 editor by the examples feature is very convenient for anyone defining a metamodel from which they will generate code. However, it seems to be a little aggressive in setting the visibility of elements to private. DataTypes of all kinds, that are defined by the metamodel, are set private; only the metaclasses remain public. It's nice to let the associations be private, too, because they aren't generally useful for code generation (I suppose association classes would be useful to publish as metaclasses, but then the code generation doesn't support them yet, anyway). So, perhaps the action can be enhanced to include a caseDataType() in its switch object that leaves all data types (which includes DataTypes proper as well as Enumerations and PrimitiveTypes). Then, the caseClassifier() still catches associations.
Created attachment 90860 [details] Proposed enhancement Attached a patch implementing the proposed enhancement
The patch has been committed.
(In reply to comment #2) > The patch has been committed. > Don't forget that the data types (primitive types and enumerations) in the source models for UML2 need to be explicitly made private so that they don't suddenly become public the next time the model is rebuilt and code is regenerated...
Created attachment 94144 [details] Updated models
Created attachment 94145 [details] Updatd models
Updated source models have been committed.
The fix is available in build 2.2.0M6.