Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » UML class model
UML class model [message #631919] Sun, 10 October 2010 15:36 Go to next message
Lunus is currently offline LunusFriend
Messages: 4
Registered: August 2010
Junior Member
Hi,

My initial motivation was to create a tool, which converts java source files to UML class diagrams.

The tool I wrote is divided into three sections. The main part is a representation of a class diagram with classes like UMLClassifier, UMLClass, UMLInterface, Stereotype, Multiplicity, Comment, Association, QualifiedAssociation, UMLVisibility and so on.
The other two parts are parsers and output generators.

When I came across XMI, of which I want to have a parser as well as an output generator, I read the book Mastering XMI, which I enjoyed, but sadly it is more about objects than classes. Nevertheless, I thought the ibm xmi framework is iteresting, but it is not maintained anymore and the webpage at ibm pointed me to the EMF project. This is actually where I started. The reason, why I did not get involved with the EMF was that I could not find documentation or tutorials which explain directly how I can create a model for a class diagram with Ecore. So even though I found classes like EClass and EAttribute, it seemed to be too complicated and I did not know whether or not it would fit my needs.
Since I would like to add XMI in and output I reconsider my decision, since it seems to be easy to generate XMI from Ecore models and vice versa.

I found an article which is great but still to short to get me started: http://www.devx.com/Java/Article/29093/0/page/2
So I guess I will give EMF another try and catch the book EMF: Eclipse Modeling Framework from the library.

Does Ecore have enough features to represent a UML 2 class diagram? For instance I need to represent interfaces, classes, comments, attributes with a type (primitive or class/interface), qualified associations with roles, visibilities for classes, interfaces, attributes, methods and roles, methods with named parameters and stereotypes to name just a few.

Any reference that may be of help is welcome.

Thanks a lot,
lunus

Re: UML class model [message #631920 is a reply to message #631919] Sun, 10 October 2010 15:53 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30551
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070907020706090308000100
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Lunus,

Comments below.

Lunus wrote:
> Hi,
> My initial motivation was to create a tool, which converts java source
> files to UML class diagrams.
> The tool I wrote is divided into three sections. The main part is a
> representation of a class diagram with classes like UMLClassifier,
> UMLClass, UMLInterface, Stereotype, Multiplicity, Comment,
> Association, QualifiedAssociation, UMLVisibility and so on.
> The other two parts are parsers and output generators.
>
> When I came across XMI, of which I want to have a parser as well as an
> output generator, I read the book Mastering XMI, which I enjoyed, but
> sadly it is more about objects than classes. Nevertheless, I thought
> the ibm xmi framework is iteresting, but it is not maintained anymore
> and the webpage at ibm pointed me to the EMF project. This is actually
> where I started. The reason, why I did not get involved with the EMF
> was that I could not find documentation or tutorials which explain
> directly how I can create a model for a class diagram with Ecore.
The UML project has already done that.
> So even though I found classes like EClass and EAttribute, it seemed
> to be too complicated and I did not know whether or not it would fit
> my needs.
You're trying to do UML but Ecore itself is too complicated...
> Since I would like to add XMI in and output I reconsider my decision,
> since it seems to be easy to generate XMI from Ecore models and vice
> versa.
> I found an article which is great but still to short to get me
> started: http://www.devx.com/Java/Article/29093/0/page/2
> So I guess I will give EMF another try and catch the book EMF: Eclipse
> Modeling Framework from the library.
>
> Does Ecore have enough features to represent a UML 2 class diagram?
It's been done already:
<http://www.eclipse.org/modeling/mdt/?project=uml2>

http://www.eclipse.org/modeling/mdt/?project=uml2

> For instance I need to represent interfaces, classes, comments,
> attributes with a type (primitive or class/interface), qualified
> associations with roles, visibilities for classes, interfaces,
> attributes, methods and roles, methods with named parameters and
> stereotypes to name just a few.
>
> Any reference that may be of help is welcome.
Have a look at http://www.eclipse.org/modeling/mdt/?project=papyrus and
http://www.eclipse.org/MoDisco/ The later is focused on reverse
engineering and likely has already done much of what you describe.
>
> Thanks a lot,
> lunus
>
>

--------------070907020706090308000100
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Lunus,<br>
<br>
Comments below.<br>
<br>
Lunus wrote:
<blockquote cite="mid:i8smbk$e1j$1@news.eclipse.org" type="cite">Hi, <br>
My initial motivation was to create a tool, which converts java source
files to UML class diagrams. <br>
The tool I wrote is divided into three sections. The main part is a
representation of a class diagram with classes like UMLClassifier,
UMLClass, UMLInterface, Stereotype, Multiplicity, Comment, Association,
QualifiedAssociation, UMLVisibility and so on.
<br>
The other two parts are parsers and output generators.
<br>
<br>
When I came across XMI, of which I want to have a parser as well as an
output generator, I read the book Mastering XMI, which I enjoyed, but
sadly it is more about objects than classes. Nevertheless, I thought
the ibm xmi framework is iteresting, but it is not maintained anymore
and the webpage at ibm pointed me to the EMF project. This is actually
where I started. The reason, why I did not get involved with the EMF
was that I could not find documentation or tutorials which explain
directly how I can create a model for a class diagram with Ecore. </blockquote>
The UML project has already done that.<br>
<blockquote cite="mid:i8smbk$e1j$1@news.eclipse.org" type="cite">So
even though I found classes like EClass and EAttribute, it seemed to be
too complicated and I did not know whether or not it would fit my
needs.
<br>
</blockquote>
You're trying to do UML but Ecore itself is too complicated...<br>
<blockquote cite="mid:i8smbk$e1j$1@news.eclipse.org" type="cite">Since
I would like to add XMI in and output I reconsider my decision, since
it seems to be easy to generate XMI from Ecore models and vice versa. <br>
I found an article which is great but still to short to get me started:
<a class="moz-txt-link-freetext" href="http://www.devx.com/Java/Article/29093/0/page/2">http://www.devx.com/Java/Article/29093/0/page/2</a>
<br>
So I guess I will give EMF another try and catch the book EMF: Eclipse
Modeling Framework from the library.
<br>
<br>
Does Ecore have enough features to represent a UML 2 class diagram? </blockquote>
It's been done already:<a
href="http://www.eclipse.org/modeling/mdt/?project=uml2"><br>
</a>
<blockquote><a href="http://www.eclipse.org/modeling/mdt/?project=uml2">http://www.eclipse.org/modeling/mdt/?project=uml2</a><br>
</blockquote>
<blockquote cite="mid:i8smbk$e1j$1@news.eclipse.org" type="cite">For
instance I need to represent interfaces, classes, comments, attributes
with a type (primitive or class/interface), qualified associations with
roles, visibilities for classes, interfaces, attributes, methods and
roles, methods with named parameters and stereotypes to name just a
few.
<br>
<br>
Any reference that may be of help is welcome.
<br>
</blockquote>
Have a look at <a
href="http://www.eclipse.org/modeling/mdt/?project=papyrus">http://www.eclipse.org/modeling/mdt/?project=papyrus</a>
and <a href="http://www.eclipse.org/MoDisco/">http://www.eclipse.org/MoDisco/</a>. 
The later is focused on reverse engineering and likely has already done
much of what you describe.<br>
<blockquote cite="mid:i8smbk$e1j$1@news.eclipse.org" type="cite"><br>
Thanks a lot,
<br>
lunus
<br>
<br>
<br>
</blockquote>
</body>
</html>

--------------070907020706090308000100--
Re: UML class model [message #631928 is a reply to message #631919] Sun, 10 October 2010 19:26 Go to previous messageGo to next message
Lunus is currently offline LunusFriend
Messages: 4
Registered: August 2010
Junior Member
Hi Ed Merks,

And thanks for your reply. I am confident that I can use the uml2 plugin. Even though it will be painful to rewrite half of my code, I guess it is worth it and I want to learn more about eclipse anyway. I did not get what exactly the capabilities of the other two projects you brought up are. The description I found is abstract. Can I use them to generate a UML class model from java sources or uml 2 class model <--> XMI conversion?
I guess I will eventually figure it out in time.
Re: UML class model [message #632149 is a reply to message #631928] Mon, 11 October 2010 18:14 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30551
Registered: July 2009
Senior Member
Lunus,

Comments below.

Lunus wrote:
> Hi Ed Merks,
>
> And thanks for your reply. I am confident that I can use the uml2
> plugin. Even though it will be painful to rewrite half of my code, I
> guess it is worth it and I want to learn more about eclipse anyway. I
> did not get what exactly the capabilities of the other two projects
> you brought up are. The description I found is abstract. Can I use
> them to generate a UML class model from java sources
MoDisco is about model discovery, i.e., reverse engineering so it
certainly sounds related.
> or uml 2 class model <--> XMI conversion?
XMI isn't really a conversion process, it's just a serialization
format. UML2 allows you to save UML instances as XMI. But class
diagrams are about more than just the abstract UML2 instance, it's also
about diagrams, and for that you need to consider how to create the
graphical description using things like the Notation model from GMF.
Papyrus is a project that lets you edit and view such graphical
representations.
> I guess I will eventually figure it out in time.
There's a lot to learn...

>
Previous Topic:[CDO] Import a fragmented model ?
Next Topic:XMI Serialization - Multiple Ecore Models with cross-references
Goto Forum:
  


Current Time: Sun Oct 20 08:20:47 GMT 2019

Powered by FUDForum. Page generated in 0.01998 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top