Book a Demo

Author Topic: Possible Defect: c++ Code engineering  (Read 2612 times)

dancindavid

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Possible Defect: c++ Code engineering
« on: September 20, 2006, 09:18:42 am »
I may have found 3 defects in c++ code engineering:

1.  When setting a class operation to be a {query} type, the const is generated for the declaration but not in the defintion of the method.

2.  Abstract classes do not survive round-trip engineering.  I can label a class as abstract and set the destructor as pure virtual.  Then, when I generate the class and then later synchronize the class, the abstract label disappears in the class diagram.

3.  When I set a parameter to be passed by reference by setting it's type to be [inout], the class shows that the parameter will be passed by reference.  However, when the code is generated, the parameter is not passed by reference.  When the code is synchronized my [inout] parameter specification disappears.

Thanks!

dancindavid

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Possible Defect: c++ Code engineering
« Reply #1 on: September 20, 2006, 09:19:43 am »
Am I correct, or misunderstanding the tool?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Possible Defect: c++ Code engineering
« Reply #2 on: September 20, 2006, 03:33:11 pm »
1) It's generating the const on both the declaration and definition for me.  What version of EA are you using, and have you modified any templates?

The other two come down to not having an exact match between UML and C++.

2) Because a C++ class can't specify that it is the parser hasn't set the class to abstract, and the abstract flag gets overridden.  Perhaps it could be made to check for any pure virtual functions and automatically set the class to abstract.

3) This one comes up every so often and there are reasons why C++ round tripping doesn't use the parameter kind.  One is that specifying an inout parameter does provide enough information to generate the miriad of possible reference types.  The other is that just because something is using a reference type, doesn't mean it's [inout].

As a result C++ code engineering expects the reference type to be included in the type field of a parameter.

dancindavid

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Possible Defect: c++ Code engineering
« Reply #3 on: September 25, 2006, 07:59:01 am »
Thank you very much for the help.

The const parameter does appear in the definition.

My mistake.

I'll be more careful next time.

:-)

David