Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Reverse engineering from java code
Reverse engineering from java code [message #878469] Tue, 29 May 2012 07:30 Go to next message
Davide M is currently offline Davide M
Messages: 17
Registered: April 2012
Junior Member
Hi,

I like create a UML model from my java code. I can create
a .uml file from my java code.

How can I then use Papyrus to put my classes on a diagram?

And what about if I regenerate the .uml file? Will the diagram
be corrupted?

Thanks in advance for any help!

Re: Reverse engineering from java code [message #878498 is a reply to message #878469] Tue, 29 May 2012 08:39 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille Letavernier
Messages: 444
Registered: February 2011
Senior Member
Hello Davide,

Quote:
How can I then use Papyrus to put my classes on a diagram?


There's currently no integrated tool to generate a Diagram from a UML Model. However, you can create most diagrams by drag & dropping elements from a UML Model.

First, you need to create a Papyrus model, associated to your uml file. To do so, select your *.uml file, then click on File > New > Papyrus Model. Select a Class Diagram (Or any other diagram), and select your Model as the root element of your new Papyrus model. This will initialize a Papyrus model related to your UML file. Then, you can open this model, and Drag-drop the elements you wish to display, from the ModelExplorer to the Class Diagram. However, it can be pretty difficult with big models, as each element has to be dropped manually.

Quote:
And what about if I regenerate the .uml file? Will the diagram be corrupted?


This depends on the tool you're using the generate the *.uml file. If it takes care of keeping the same IDs, the Diagrams will work fine (ie. it will detect renamed or deleted elements). However, if the tool creates a whole new uml file, then you'll have to create a new diagram.


Regards,
Camille


Camille Letavernier
Papyrus developer
Re: Reverse engineering from java code [message #880950 is a reply to message #878469] Sun, 03 June 2012 09:07 Go to previous messageGo to next message
Cedric Dumoulin is currently offline Cedric Dumoulin
Messages: 34
Registered: July 2009
Member
Hi,

Papyrus extra plugins contain some Java reverse tool plugins.
This plugins allow to select one or more java classes or packages
from the "packages explorer", and to reverse them into the current
Papyrus UML model.
The use of this plugins is very easy: select the classes or packages
to reverse, and click "java reverse". Your classes, and their properties
and methods will be reversed into your current Papyrus model.

The plugin do not create diagrams: you have to do "drag and drop" to
put the reversed classes into a class diagram.
This plugin do reverse in a "incremental way". This means that
selected classes are added to the current model. So, existing diagrams
are not affected. The plugin allows to reverse classes in an existing
uml model. It also allows to specify some mappings saying into which
packages some classes should be reversed.

Hope this help,

Cedric

Plugins:

- org.eclipse.papyrus.java.reverse
- org.eclipse.papyrus.java.reverse.ui
located in mdt.papyrus/trunk/extraplugins/java


Davide M a écrit :
> Hi,
>
> I like create a UML model from my java code. I can create
> a .uml file from my java code.
>
> How can I then use Papyrus to put my classes on a diagram?
>
> And what about if I regenerate the .uml file? Will the diagram
> be corrupted?
>
> Thanks in advance for any help!
>
>
Re: Reverse engineering from java code [message #881428 is a reply to message #878469] Mon, 04 June 2012 10:41 Go to previous messageGo to next message
Davide M is currently offline Davide M
Messages: 17
Registered: April 2012
Junior Member
Hi Camille and Cedric,

thanks for the help! I am making some easy experiments with the tool.

I have created a simple uml model and a papyrus diagram. I have
dragged and dropped classes from the model to the diagram.

Then I have closed the diagram. I have opened the uml model and deleted
a property of a class. Then I have reopened the diagram.
Now the class in diagram show a property like this:

+ null: Undefined

I thinks was the place of the deleted property. I am making something
wrong?

Or papyrus will detect only deleted classes?

If I use papyrus to show my code, is normal that I will add
or remove classes, attributes or associations.

Can this done by papyrus?

Thanks in advance for any help!

Bye!
Re: Reverse engineering from java code [message #881481 is a reply to message #878469] Mon, 04 June 2012 12:28 Go to previous messageGo to next message
Davide M is currently offline Davide M
Messages: 17
Registered: April 2012
Junior Member
Hi,

I have just deleted a class from the model and now the diagram
will throws a NPE.

The problem look like be in the .notation file that has
a reference to the deleted class.

Re: Reverse engineering from java code [message #881487 is a reply to message #881481] Mon, 04 June 2012 12:42 Go to previous messageGo to next message
Davide M is currently offline Davide M
Messages: 17
Registered: April 2012
Junior Member
Hi Cedric,

I have quick looked at the plug-in. Why don't use JDT as java parser?

There is more documentation about the plug-in: install, architecture.

During reverse engineering was uses some standard to recognized
UML pattern or simple the java code is mappend 1-1 to a diagram?

Re: Reverse engineering from java code [message #903431 is a reply to message #880950] Thu, 23 August 2012 11:23 Go to previous messageGo to next message
John Missing name is currently offline John Missing name
Messages: 1
Registered: August 2012
Junior Member
Hi Cedric - Can one obtain builds of the reverse engineering plugins? I can't seem to find them in the usual Hudson locations. Is building them myself the only option?

Thanks
John
Re: Reverse engineering from java code [message #986379 is a reply to message #903431] Tue, 20 November 2012 04:54 Go to previous messageGo to next message
Mirek Gra is currently offline Mirek Gra
Messages: 4
Registered: November 2012
Junior Member
Have a look at this thread:
http://www.eclipse.org/forums/index.php/t/149226/


Re: Reverse engineering from java code [message #986397 is a reply to message #986379] Tue, 20 November 2012 05:29 Go to previous messageGo to next message
Mirek Gra is currently offline Mirek Gra
Messages: 4
Registered: November 2012
Junior Member
(comment to my previous message: The linked thread 149226 seems to be moderated, messages need to be verified to be shown, but the moderator seems to be dead...)

Google returned new URLs, they seem to work (however, it's only source code):
https:// (breakline)
speedy.supelec. (breakline)
fr/Papyrus/svn/Papyrus/branches/CQ/other/org.eclipse.papyrus.java.reverse/


https:// (breakline)
speedy.supelec. (breakline)
fr/Papyrus/svn/Papyrus/branches/CQ/other/org.eclipse.papyrus.java.reverse.ui/
Re: Reverse engineering from java code [message #1008765 is a reply to message #986397] Wed, 13 February 2013 15:15 Go to previous message
PHIL C is currently offline PHIL C
Messages: 10
Registered: March 2012
Junior Member
Hi

Do you have made reverse code ?

Regards
Phil
Previous Topic:How to create a Template Class with Papyrus
Next Topic:creation of a graphical editor with topcased
Goto Forum:
  


Current Time: Mon Sep 01 19:40:35 EDT 2014

Powered by FUDForum. Page generated in 0.01971 seconds