Book a Demo

Author Topic: Showing constructors on class diagrams.  (Read 7201 times)

rgsheehan

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Showing constructors on class diagrams.
« on: July 12, 2012, 06:11:34 am »
Hello all,
It seems trivial, but I have apparently forgotten how to get EA to show constructor/destructors on class diagrams.  I actually have a model stub that shows them, but all my new classes do not, even though they show any other operations and attributes I create for the class.  So three questions:
1. How to get constructor displayed on class diagrams.
2. Why would EA not show them by default?
3. Where could I have found the answer to this in the so-called 'Help' documentation.


Thanks in advance.

R. G. Sheehan

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Showing constructors on class diagrams.
« Reply #1 on: July 12, 2012, 06:59:05 am »
You can only show them if you have defined them as operation. To show the operations compartment check the diagram properties: Elements/Operations.

q.

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Showing constructors on class diagrams.
« Reply #2 on: July 12, 2012, 05:28:05 pm »
Hi
There is an option the settings for code engineering that specifies if a constructor/destructor is generated when code for the class is generated.
Reverse engineering will the of course add the operations to you class
Using V12

rgsheehan

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Showing constructors on class diagrams.
« Reply #3 on: July 12, 2012, 11:02:39 pm »
SomersetGraham,

Yes, the approach you suggested works.  Thank you.  Not sure what Sparx is thinking here.  It sure seems to me to be a convoluted, roundabout, non-intuitive approach to what would arguably be a primary usage of the tool.

Anyway, thanks again.

R. G. Sheehan

SomersetGraham

  • EA User
  • **
  • Posts: 376
  • Karma: +1/-0
    • View Profile
Re: Showing constructors on class diagrams.
« Reply #4 on: July 12, 2012, 11:10:39 pm »
Well the code generation only makes a default constructor which is not always what you want
You can define more constructors using the operations page
Using V12