Take the 2-minute tour ×

I want to model c# class attributes and variable attributes (not UML attributes) in UML and am not sure how to do it.

class SomeClass
    int SomeField;

    int SomeMethod(
    	[AttributeForTheParameter]int someParam)

How do you model:

[AttributeForTheClass] and [AttributeForTheField] and [AttributeForTheMethod]

Currently we use Sparx Enterprise Architect.

I know that c# attributes are a c# language feature but I am not sure they are even defined in UML.

Anyone have a solution?

share|improve this question
Is this still an open question for you? If you could add some details I think I could get this question answered. –  Ted Johnson May 22 '09 at 17:01

2 Answers 2

What happens when you reverse engineer some C# code which has attributes? Do you get stereotypes or tagged values?

From a modelling view, they should be stereotypes and any parameters of the attributes should be tagged values, but it's easier to go with what the tool supports if it can.

share|improve this answer

EA imports attribtues as tagged values with the name "Attribute", and the text of the attributes, concatenated, as the value:

[WebService(Namespace = "http://dataservice/")];[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)];[System.ComponentModel.ToolboxItem(false)]

share|improve this answer

Your Answer


