Attributes provide a powerful method of associating declarative information with C# code (types, methods, properties, and so forth). Once associated with a program entity, the attribute can be queried at run time and used in any number of ways.
[TestClass]
public class MyTests
{
[TestMethod]
public void DoSomeTest()
{
}
}
In looking the above example, we have MyTest
class which has the [TestClass]
, and the DoSomeTest()
which has [TestMethod]
attribute.
TestClass
and TestMethod
both of them are subclass of System.Attribute
in C#
.
Actually in this example the MyTest
class has two dependencies to TestClassAttribute
and TestMethodAttribute
.
In analyze phase, we produce the results based on UML
models. these results also should be able to support code generation for C#
compiler. the developer team supposed to implement Asp.Net MVC
application type. they implement some parts of the application logic in attributes way. they say the attributes have a lot of advantages. OK.
The problem is that we cant produce the attributes in UML standards. or I don't know!
I tried some solutions such : How do I formally document a C# Attribute in UML
but the drawback of them is that we don't have any constraint or controls on attributes. we can't control consistency of the attributes in our project.
Please answer:
- How the
UML
covers the attributes (C# attributes)? - Is there any
UML
designer which supports this feature, and what is the best? or which tools you suggest me?
Thanks.