Bug 220558 - Convert to Metamodel action makes too many elements private
Summary: Convert to Metamodel action makes too many elements private
Status: VERIFIED FIXED
Alias: None
Product: MDT.UML2
Classification: Modeling
Component: Core (show other bugs)
Version: 2.2.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: M6   Edit
Assignee: James Bruck CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-02-27 09:48 EST by Christian Damus CLA
Modified: 2012-05-22 12:01 EDT (History)
1 user (show)

See Also:


Attachments
Proposed enhancement (1.74 KB, patch)
2008-02-27 09:49 EST, Christian Damus CLA
Kenn.Hussey: iplog+
Details | Diff
Updated models (306.01 KB, patch)
2008-03-30 15:12 EDT, James Bruck CLA
no flags Details | Diff
Updatd models (41.18 KB, patch)
2008-03-30 15:16 EDT, James Bruck CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2008-02-27 09:48:16 EST
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.
Comment 1 Christian Damus CLA 2008-02-27 09:49:47 EST
Created attachment 90860 [details]
Proposed enhancement

Attached a patch implementing the proposed enhancement
Comment 2 James Bruck CLA 2008-03-24 15:58:11 EDT
The patch has been committed.
Comment 3 Kenn Hussey CLA 2008-03-24 16:21:26 EDT
(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...
Comment 4 James Bruck CLA 2008-03-30 15:12:58 EDT
Created attachment 94144 [details]
Updated models
Comment 5 James Bruck CLA 2008-03-30 15:16:58 EDT
Created attachment 94145 [details]
Updatd models
Comment 6 James Bruck CLA 2008-03-31 10:46:38 EDT
Updated source models have been committed.
Comment 7 Kenn Hussey CLA 2008-04-25 10:15:49 EDT
The fix is available in build 2.2.0M6.