Book a Demo

Author Topic: Roundtrip engineering of C++ comments  (Read 6125 times)

Molto Mike

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
    • View Profile
Roundtrip engineering of C++ comments
« on: June 28, 2002, 08:52:33 am »
Hi,

I am evaluating EA for C++ oriented modelling and have some questions about how importing/reverse engineering and exporting/forward engineering of comments is supported.

What are the requirements for comments in a header file so that class descriptions, method descriptions, parameter descriptions (possible in C++ rev.-eng. in EA?) are picked up during reverse engineering?

Should I use Javadoc compliant comment style?

TIA,
Mike
« Last Edit: June 28, 2002, 02:46:00 pm by molto_b »

Tjerk

  • EA User
  • **
  • Posts: 231
  • Karma: +1/-0
    • View Profile
Re: Roundtrip engineering of C++ comments
« Reply #1 on: July 02, 2002, 02:29:50 am »
Hi Mike,

I have found the following behaviour on comment roundtrip engineering.

Class notes (forward):
- comment starts with '/*'
- no changes are made in comments (including tabs and enters)
- comment ends with '*/'

Class notes (reverse):
- Some asterixes are removed (sorry not yet further explored)
- CR/LF are removed, with the following exceptions:
  - when there is not a '.' at the end of a line
  - when there is a '-' at the start of the next line

Method notes (forward):
- comments start with '/**'
- each line starts with '* '
- rest of comments is not changed
- comments end with '*/'

Method notes (reverse):
- Seems to reverse the forward engineering

Method behaviours (forward):
- each commentline starts with '//'

Others:
- Haven't tested other comment roundtrip engineering yet.

-------------------
I personally think that forward engineering is pretty OK, but reverse engineering comments (and code) is not solid and therefore not useable yet.

Furthermore, I think that some of the note fields (e.g. with methods) are rather small to include the extensive documentation I would like.
-------------------------
Suggestions to Sparx:
- Provide the rules of comment engineering for all kind of note fields.
- Provide a larger box for method notes.
- Provide settings (in profile) for changing comment styles.
- Besides behaviour, I would like to have a field (same size) for the code I want to include.

In general:
I think that Sparx needs to concentrate on forward and reverse engineering code. This board already mentions some cavities in both forward and reverse engineering that makes the tool, in my opinion, rather useless in roundtrip engineering.

So, instead of adding nice features (and know that I would like them all, now, :) of course), I think Sparx needs to concentrate on the already included functionality.

For the short term, I would like to be notified on the focus of the Sparx team efforts, and possibly on the above issues.

Greetings,
Tjerk

Tjerk

  • EA User
  • **
  • Posts: 231
  • Karma: +1/-0
    • View Profile
Re: Roundtrip engineering of C++ comments
« Reply #2 on: July 02, 2002, 06:32:56 am »
Additional information:

Attribute notes (forward):
- Comments not generated

Attribute notes (reverse):
- comments are reverse engineered when they are placed before the attribute using '/*' and '*/', does not work with '//'.

----------
If somebody has remarks on the comments roundtrip engineering, please reply on these posts so that everything on this topic is collected for Geoff and his team.

Tjerk

Tjerk

  • EA User
  • **
  • Posts: 231
  • Karma: +1/-0
    • View Profile
Re: Roundtrip engineering of C++ comments
« Reply #3 on: July 31, 2002, 06:23:54 am »
Hi Geoff,

Thanks for working on the comment engineering and the code generation in release 500. However, the comment generation has changed in the new 500 release.

Previously, a '.' followed by an enter was reverse engineered to the same '.' and a newline in the model notes.

In the 500 release, it seems like all the newlines are removed from the comments when reverse engineered. This makes most of the comments unreadable (specially the larger comment blocks).

Is there a way to obtain newlines in the reverse engineered comments?

Greetings,
Tjerk

Ps.: I have not read all the documentation of EA, but can anyone give me some references to the guidelines of the plain comment (EA), JavaDoc en .Net doc roundtrip engineering?

Molto Mike

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
    • View Profile
Re: Roundtrip engineering of C++ comments
« Reply #4 on: July 31, 2002, 08:18:19 am »
Regarding the comment styles, you can simply create a class and forward engineer. EA will generate the way it expects the comments during roundtrip engineering.

Looks pretty good.

However, I still miss eny possibility to document return values *at all* in EA.

Mike

Tjerk

  • EA User
  • **
  • Posts: 231
  • Karma: +1/-0
    • View Profile
Re: Roundtrip engineering of C++ comments
« Reply #5 on: July 31, 2002, 10:24:00 am »
Hi Molto_b,

If I generate comments for e.g. class notes that uses newlines and I reverse engineer that same class back into the model, all the newlines have disappeared. Don't you have this problem?

Tjerk

Molto Mike

  • EA User
  • **
  • Posts: 66
  • Karma: +0/-0
    • View Profile
Re: Roundtrip engineering of C++ comments
« Reply #6 on: August 01, 2002, 08:22:51 am »
Hey,

no, you're right. The way comments were handled before seems different WRT the lineendings. Did you notice that during repeated roundtrip engineering steps, the class documentation is changed due to comments added by EA (in JavaDoc mode). So after 5 rounds, your class comment now has 5 lines of "modified..." in it.

I hardly think this was intended. Poor testing?

Mike

gsparks

  • EA User
  • **
  • Posts: 325
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Roundtrip engineering of C++ comments
« Reply #7 on: August 02, 2002, 05:23:33 am »
Hi,

There is an option on the View/Options/Generation dialog page .. "Remove Hard Breaks on Import" - uncheck this and EA should not remove the formatting.

The "Modified" comment that keeps growing was left in as it was already in the Javadoc generator ... but I concur that after a number of iterations it can become brudensome. Ill look at providing an option to disable it - or to limit it to a number of entries.

I apologise that there is some catching up to do on the documentation for this - I will get it organised and incorporated in the next couple of weeks.

Regards,
Geoff Sparks



Tjerk

  • EA User
  • **
  • Posts: 231
  • Karma: +1/-0
    • View Profile
Re: Roundtrip engineering of C++ comments
« Reply #8 on: August 02, 2002, 05:30:51 am »
Hi Geoff,

Sorry, missed the new setting on the removal of hard breaks. I'm off on a holiday and will check this setting when I'm back. When the new documentation / help is available I will work through that first.

Thanks for all the good work on EA!

Greetings,
Tjerk