MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - Reverse-engineering the code?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Reverse-engineering the code?

 Post Reply Post Reply
Author
Message
janne View Drop Down
MetaCase
MetaCase
Avatar

Joined: 25.Mar.2008
Points: 58
Post Options Post Options   Thanks (0) Thanks(0)   Quote janne Quote  Post ReplyReply Direct Link To This Post Topic: Reverse-engineering the code?
    Posted: 24.Jun.2008 at 09:44
This was asked recently several times so I decided to share it here too:

> Can I use MERL for reverse engineering (code->model)?

There are many ways to import data from external sources, see a summary of the importing scenarios from: www.metacase.com/mwb/model_import.html

In the picture the scenario 6 presents way how MetaEdit+ utilizes MERL for importing the data from the external source. This can be described also as a reverse engineering the code back to the model approach.

MetaEdit+ repository contains an example where Java classes (*.java) and their attributes are reverse engineered to UML Class Diagram models.

You can test the reverse engineering functionality in MetaEdit+ by:
•          Open “UML examples” project and set it as a default project
•          Open “Reverse engineered Java (ex 1)” model
•          Place some Java classes (*.java) into the MetaEdit+ 4.5\reports subfolder OR run a 'Build' generator for '2008Models' (in Digital Watch project), which will generate the Java files for Digital Watch product family
•          Run the “Reverse engineer Java” generator, which will create a MXM file, and import it to the default project with name “Reverse engineered Java #index number”
•          Open the resulted model and select a Diagram for its representation

All the generator scripts are accessible for every user and they can be modified or extended further to have more complete information for the classes, e.g. having also the Operations or relationships between the classes.



Edited by janne - 24.Jun.2008 at 09:50
Back to Top
me View Drop Down
Member
Member


Joined: 17.Jan.2011
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote me Quote  Post ReplyReply Direct Link To This Post Posted: 19.Jan.2011 at 01:47
Hello Janne,
 
I've loaded the "UML examples" project but can't find the “Reverse engineered Java (ex 1)” model and the “Reverse engineer Java” generator.
Do I have a different repository-version ?
Back to Top
janne View Drop Down
MetaCase
MetaCase
Avatar

Joined: 25.Mar.2008
Points: 58
Post Options Post Options   Thanks (0) Thanks(0)   Quote janne Quote  Post ReplyReply Direct Link To This Post Posted: 19.Jan.2011 at 08:59
Hi,

There shouldn't be different versions, so all demo repositories having the project 'UML examples' should have the "Reverse engineered Java (ex 1)" (Class Diagram) as well as the generator named "Reverse engineer Java" available.

Could you please describe which Graphs (names?) do you have available after opening the UML Examples project?
Back to Top
me View Drop Down
Member
Member


Joined: 17.Jan.2011
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote me Quote  Post ReplyReply Direct Link To This Post Posted: 20.Jan.2011 at 00:37
Hello Janne,
 
When I've opened the project "UML examples", in the Graph Browser, there are graphs called
  • Ball Game (with subgraphs)
  • ChartTool
  • CORBA IDL
  • Delphi example
  • Watch frame work
 
 
 
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 20.Jan.2011 at 01:32
Either you have accidentally deleted the "Reverse engineered Java (ex 1)" graph, or then you have a 4.5 repository rather than 4.5 SR1. The easiest way to tell is that SR1 also added a Note object to the Watch Framework graph.

Assuming you have SR1, you can run the "Reverse engineer Java" generator on any UML Class Diagram - it doesn't use the diagram itself at all, but instead creates a new one based on the Java files in your reports directory. The generator is not intended to be a full reverse engineering tool for Java to UML (MetaEdit+ is a DSM tool not a UML tool!), but to show you the kind of thing you could build using MERL if you needed.
Back to Top
me View Drop Down
Member
Member


Joined: 17.Jan.2011
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote me Quote  Post ReplyReply Direct Link To This Post Posted: 20.Jan.2011 at 23:19

I have version 4.5 dev 66, I think that is still 4.5.

Can I download somewhere a copy of the "Reverse engineer Java" generator. I want to create a merl-generator to reverse engineer some 'quite old' data definitions language dialects.
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 20.Jan.2011 at 23:45
Correct: 4.5 Dev 66 = base 4.5. 4.5 Dev 92 = SR1.

You need SR1 if you want to do reverse engineering. You want to read a file into a variable and then iterate over its lines, and "do $var" was added in SR1.
Back to Top
me View Drop Down
Member
Member


Joined: 17.Jan.2011
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote me Quote  Post ReplyReply Direct Link To This Post Posted: 21.Jan.2011 at 01:33
That's a pitty. I bought the tool a long time ago, and re-started recently again in trying out some constructions.
 
In doing that and trying some forward enginering based on a graph, I wonder if it is possible to hypertext occurences of type(s) in the text-editor and use that as generated output, for instance:
 
... free text ...   < occurence of type > ... free text ...
 
where you can select the occurence of type from a list. It could be usefull if a textual specification is more convenient then a graphical one, and you don't want to change text before generating if the name of an occurence of type is changed somewhere.
 
 
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 21.Jan.2011 at 11:09
Your name here doesn't tell me much Smile, so I'm not sure what kind of license you have and whether you'd already be eligible for the SR1 upgrade. Please contact info@metacase.com and they'll sort things out.

I guess your second question is about putting objects in text, so that the visible text updates if the object's name changes? That's certainly been something we've thought about, but it's not part of the current product. There would seem to be substantial technical challenges, in that any library for working with text will be large, and assume one character per slot. Having a slot contain a variable number of characters would break pretty much everything. There are various ways that could be tried to get around this, but my guess is that some other components that work with text would break, because they contain implicit assumptions about the internal implementation of text.
Back to Top
Audra View Drop Down
Member
Member
Avatar

Joined: 12.Apr.2011
Location: SUITE
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Audra Quote  Post ReplyReply Direct Link To This Post Posted: 12.Apr.2011 at 09:50
Originally posted by stevek stevek wrote:

Your name here doesn't tell me much Smile, so I'm not sure what kind of license you have and whether you'd already be eligible for the SR1 upgrade. Please contact info@metacase.com and they'll sort things out.

I guess your second question is about putting objects in text, so that the visible text updates if the object's name changes? That's certainly been something we've thought about, but it's not part of the current product. There would seem to be substantial technical challenges, in that any library for working with text will be large, and assume one character per slot. Having a slot contain a variable number of characters would break pretty much everything. There are various ways that could be tried to get around this, but my guess is that some other components that work with text would break, because they contain implicit assumptions about the internal implementation of text.
I download somewhere a copy of the "Reverse engineer Java" generator.

Edited by stevek - 12.Apr.2011 at 11:48
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.086 seconds.