Star UML: how to add get/set properties

dotnet-practitioner picture dotnet-practitioner · Nov 3, 2009 · Viewed 12.8k times · Source

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

Answer

drewberk picture drewberk · Dec 7, 2009

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.