0

I can't get the **int getId() const; member function to be generated by enterprise architect

How do I specify a constant member function in enterprise architect?

m4l490n
  • 1,592
  • 2
  • 25
  • 46

1 Answers1

2

Simply select your class and hit F10 to bring up the Operations Dialog. Select the Advanced tab on the left hand side. In the Modifiers section check "Is Query"

This corresponds to the Const keyword specifying the method doesn't modify any fields.

You can read more about this form the Sparx Systems website, on their online help documentation.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
TomO
  • 708
  • 4
  • 13
  • Unlike forum sites, we don't use "Thanks", or "Any help appreciated", or signatures on [so]. See "[Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts). – John Saunders Mar 12 '13 at 00:29
  • There is a modifier const as well in same dialog. Do we need to check it for const method? – Pabitra Dash Feb 25 '22 at 10:20