Book a Demo

Author Topic: Parameterized Classes (Templates)  (Read 3491 times)

JLove

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Parameterized Classes (Templates)
« on: February 24, 2005, 10:19:54 am »
The UML diagram created by EA for Parameterized Classes (Templates) does not conform to the UML "standard" notation.  The Template Parameter should NOT show a Type in the diagram, only the Parameter.

For example, the notation example in the online help shows CAutoMemRelease with two template parameters T and DeAllocator.  This is notated by a dashed box in the upper right of the class diagram with "class:T" and "class:DeAllocator".  However, if you look a notation examples in some industry standard reference books, such as UML Distilled you will see the notation inside a dashed box as simply "T" and "DeAllocator".  What's even stranger is that if you create a Parameterized Class (Template) in EA (build 744) the notation is "T:class" and "DeAllocator:class", which is the reverse order from the notation example in help!

Are there any plans to fix the EA notation for Parameterized Classes (Templates) to conform to the industry standard, or provide an option to turn off the ":Type" / "Type:" notation?  Leaving the Type blank does not resolve the notation syntax as that will still have a ":" in the diagram.
James Love
Software Engineer
SenDx Medical, Inc.
A Division of Radiometer Copenhagen

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Parameterized Classes (Templates)
« Reply #1 on: February 24, 2005, 02:22:06 pm »
The UML 2.0 Superstructure says the notation for template parameter is:

Quote
template-parameter ::= template-parameter-name [ ‘:‘ parameter-kind ] [‘=’ default]

So parameter kind is optional, and I can't find an option in EA to hide it so I would say you exercise that option by leaving it blank. We need to remove the colon when the parameter kind is blank though - that's easy enough to do. (We also need an up-to-date diagram for the help file).
The Sparx Team
[email protected]

JLove

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Parameterized Classes (Templates)
« Reply #2 on: February 24, 2005, 03:58:54 pm »
Thanks for the prompt reply.

I'm not sure leaving the Type blank is the right solution.  For example, "class" might be needed for C++ code generation but not desired on the UML notation.  It seems to me that the right solution is to provide an option on the dialog interface under Class > Detail > Templates or Diagram Properties > Appearance Options.

Either way, it's nice to know you're listening.  Can we expect a solution for this notation "glitch" in one of the next builds anytime soon?
James Love
Software Engineer
SenDx Medical, Inc.
A Division of Radiometer Copenhagen