Search code examples
class-diagram

Visual Paradigm set attribute to final in class diagram


Hello I want to draw a class diagram with Visual Paradigm and I have to set my attributes to "final".

I tried the following Syntax: -final id : UUID

When I generate a getter it looks like this: +getFinal id() : UUID

I expected +getId() : UUID


Solution

  • UML does not specify what 'final' means. That is a Java keyword.

    Place a readOnly modifier on your property.

    In order for that to show up in the diagram, you must right click the diagram, go Presentation Options, go Attribute Display Options and tick Show Property Modifiers. Example