Why are the class diagrams rendered with non-standard syntax?

0 votes
asked Feb 14, 2013 in Wanted features by anonymous
For example, the UML standard I'm familiar with specifies a class attribute in this way:

Attribute: Type = DefaultValue

PlantUML shows something like this instead:

Type Attribute = DefaultValue

1 Answer

0 votes
answered Feb 15, 2013 by plantuml (295,000 points)
Hello,

I guess that you are refering to HUTN (Human Usable Textual Notation)
http://www.eclipse.org/epsilon/doc/articles/hutn-basic/
(If you are not, thanks for giving us the references/URL to your tool)

HUTN indeed allows:
Family {
  familyFriends: Family "bloggs"
}

For PlantUML, we have choose something closer to Java/C++/C#/PHP.
In those programming language, the type/class of an attribute is put before:
class Family {
    Family familyFriends = ...
}

The guess is that people are more used to this notation rather than the HUTN one.

But we may consider a @starthutn if there is a real need here.
Anyone knows a free HUTN parser implementation in Java ?
commented Feb 15, 2013 by anonymous
I'm referring to PlantUML's rendered output diagram rather than the syntax used to specify the input. The UML diagrams I have been using look like those seen here:

http://www.ibm.com/developerworks/rational/library/content/RationalEdge/sep04/bell/

It would be nice to have an option to create output like that. It would not be necessary to change the notation PlantUML parses to generate the diagram.
commented Feb 15, 2013 by plantuml (295,000 points)
You can do that:
@startuml
class Flight {
   flightNumber : Integer
   departureTime : Date
}
@enduml
You will have the following result : http://www.plantuml.com/plantuml/img/Iyv9B2vMSCl9JCyeKQZcvL9GK4W3S_nASvDIYnIi53ppIbBJKul0KYcf1Ob59QL5gI6PkQb0EPV4abHUhbe0

Is it what you are expecting ?
commented Feb 15, 2013 by anonymous
Yes! I didn't realize that would work; the documentation I was reading uses C-like syntax, so I thought that was the only way to do it with PlantUML:

http://plantuml.sourceforge.net/classes.html

Thank you!
commented Feb 18, 2013 by plantuml (295,000 points)
Ok, we have updated the documentation about this.
Regards,
commented May 20, 2015 by anonymous
The "HUTN Specification"(http://www.omg.org/spec/HUTN/1.0/PDF) mentions a proof-of-concept implementation in Java using ANTLR.
Although I have yet to find the sources, I would very much appreciate HUTN support in PlantUML, because it will allow for interoperability with other modeling software, and if there is a standard, I think it's almost always best to stick to it...
...