Book a Demo

Author Topic: Showing default parameters?  (Read 3249 times)

simon.marshall

  • EA Novice
  • *
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Showing default parameters?
« on: December 07, 2005, 03:53:44 am »
EA shows class attribute initial values in class diagrams, e.g., "_x : int = 0", but not class operation parameter default values.

I appreciate that they can be viewed as different concepts, but I still think it would very be useful to show this info on the diagram in the same way, i.e., "M(x : int = 0)".

Is there a reason why they are not?  Simon.

tletsch

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Showing default parameters?
« Reply #1 on: January 10, 2007, 02:49:48 am »
I'm having the same problem.
Is this still a problem?
UML does define the notation Simon suggested, doesn't it?

Thomas

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Showing default parameters?
« Reply #2 on: January 10, 2007, 02:12:05 pm »
Yes, is still appears to be a problem.

Report it as a bug using the [size=13]Support[/size] link at the top of the page.  Reference this Topic so that Sparx can see any additional input.  If they respond can you add to the topic?


You are correct that the [size=13]UML 2.1 Superstructure (interim)[/size] Specification supports that syntax in section 7.3.36 Operation (from Kernel, Interfaces), subsection Notation:
<parameter-list> ::= <parameter> [‘,’<parameter>]*
<parameter> ::= [<direction>] <parameter-name> ‘:’ <type-expression>
[‘[‘<multiplicity>’]’] [‘=’ <default>] [‘{‘ <parm-property> [‘,’ <parm-property>]* ‘}’]


HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Showing default parameters?
« Reply #3 on: January 10, 2007, 03:10:13 pm »
Of course, the specification doesn't specify that the default must be displayed if it exists.  So EA is perfectly compliant with the specification, even if you would prefer a different display.

tletsch

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: Showing default parameters?
« Reply #4 on: January 15, 2007, 05:45:36 am »
Yes, thats right.

But for understanding and using a class diagram, the information of default parameter is quite helpful (maybe even more than attribute initial values). So I placed a 'request a feature' on the support page.

Thanks to all for your help and information
Thomas