Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » How to specify enum as attributes using Rational Software Modeler(EMF enum RSM)
|
Re: How to specify enum as attributes using Rational Software Modeler [message #782664 is a reply to message #782615] |
Tue, 24 January 2012 07:16 |
Ed Merks Messages: 33133 Registered: July 2009 |
Senior Member |
|
|
Edmund,
Comments below.
On 24/01/2012 4:52 AM, Edmund Reinhardt wrote:
> Hi Ed, it's been a while.
> Last time I was using EMF, I used Rational Rose for the diagramming.
Not exactly an open source tool. :-P
> I have persuaded a new project to go with EMF for the model and I have a couple of question.
>
> 1) enum
> Now that Java 5 has been around for a while, can EMF generate the native Java enum for enum attributes?
Yes. It was even nice that we could generate them in a binary
compatible way.
> I am using Rational Software Model now to create the class diagrams, how do I go about specifying that I want to use an enum for a particular attribute.
So you're using UML2...
> I can't find the stereotype to make it work. Is there some features I need to install/configure?
Maybe UML2 has enumerations.
> I have researched on the internet and applied the ePackage stereotype but I still can't find the EMF<<enum>> stereotype. Can you tell me what modelling idiom to use to get this simple result?
> If I use the Java enum, the EMF reload sees it as a java.lang.Object.
> (see screen shots)
>
>
>
>
> 2) How do I specify that a Class should implement an Interface. If I use the UML Interface
Unfortunately I'm not sure how to do either, and these days I haven't
got UML2 source in my workspace.
There's Ecore Tools which you can use to create diagrams directly for
Ecore; it's not as polished as IBM's produce though.
>
> A generalization relationship is not allowed and the realization relationship doesn't generate anything in the model .java.
Here's a good way to get the tool to provide the answer. Take your
Ecore model, create a GenModel for it; from the context menu for the
resource using File->New->Other...->Eclipse Modeling Framework->EMF
Generator Model. Then open the Generator model, and from the context
menu of the root, use Export Model... to export it to UML2. I believe
that should produce a UML2 instance that, when reimported to Ecore, will
produce the original Ecore model again.
I'm pretty sure UML2 provides a specialized Ecore profile that's used to
record/specify details not directly specifiable in UML2; this will help
you discover it and how to use it.
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | | | |
Re: How to specify enum as attributes using Rational Software Modeler [message #783186 is a reply to message #782976] |
Wed, 25 January 2012 08:51 |
Ed Merks Messages: 33133 Registered: July 2009 |
Senior Member |
|
|
Edmund,
Thanks for the details from your investigation. They will help the next
person who has the same problem!
On 24/01/2012 10:18 PM, Edmund Reinhardt wrote:
> Here is the answer to the enum mystery
> (Thanks for your help, both Eds)
>
> In order to get access to the Ecore primitive types, you need import the model library.
> But the instructions on the internet are dated because are for RSA 6.x and I am working with RSA 8.x.
> {can put http because the forum doesn't trust me to put links in yet)//sdqweb.ipd.kit.edu/wiki/Creating_EMF-Models_with_RSA#Using_ECORE_data_types
>
> To do this for 8.x, you need to open the model in an editor and go to the Details tab and hit the import button there.
> See {can put http because the forum doesn't trust me to put links in yet)//www.ibm.com/developerworks/forums/thread.jspa?messageID=14644708
>
> But there was one more wrinkle. The<<eenum>> stereotypes only apply to UML Enumerations, and none were visible on my palette, even after digging under the divoted Class icon.
> But they were visible on the models I imported via Ed and Ed's advice. The problem was that by default on the package's properties, under the Capabilities tab, some of the UI elements were filtered out.
> See
>
>
> By unchecking this filter, the Enumeration became visible on the palette and the eenum stereotypes could be applied.
>
>
> Thanks again for all your help.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Tue Apr 16 15:49:22 GMT 2024
Powered by FUDForum. Page generated in 0.36496 seconds
|