Search code examples
umlstaruml

Star UML: how to add get/set properties


I have started using Star UML application and its great. Is there a way to add get/set functions and foward/reverse engineer the code.

Thanks


Solution

  • Create an operator then set the stereotype to CSharpProperty.

    Example:

    1. Right-click the class in the Model Explorer
    2. Select Add -> Operation
    3. In the property pane add the CSharpProperty stereotype.
    4. Add a "return" parameter (right-click the new operation and select Add -> return)
    5. Set the Type to the property type (e.g. int, string, etc.)
    6. Set the DiretionKind to Return

    The above steps should produce C# code with both an accessor and modifier when StarUML generates the code.