How to represent a C# property in UML?

后端 未结 12 818
夕颜
夕颜 2020-12-08 19:03

Not quite an Attribute, not quite a Method. Stereotypes? <> <>?


I\'m retro-modelling an existin

12条回答
  •  甜味超标
    2020-12-08 19:50

    Properties are just a convenient way of writing get_MyValue() and set_MyValue(value) allowing assignment rather than the normal method calling (using parenthesis).

    What you are accessing is actually a .NET property, C# has its own syntax for accessing these. Since under the skin the real get_ and set_ methods are created, so you could simply show those methods (to make your UML language independent - e.g. make your UML equally applicable to a VB.NET developer)

    ... or as you have suggested, introduce your own stereotype!

提交回复
热议问题