Attributes provide extra information about your code that allows tools such as Visual Studio to make using your code easier. For example, they tell the Properties window how to display and edit properties and they let you fine-tune XML serialization.
by Rod Stephens
September 13, 2006
hen I first saw attributes in Visual Studio .NET, I thought they were some sort of oddity Microsoft had dragged in from Java, C++, or perhaps the Delta Quadrant. They clearly aren't Visual Basic code. To someone who uses angle brackets only for comparing two numbers, this Property statement, <XmlIgnore(True)> Public Property Salary() As Decimal, looks like it's been infected by the Borg!
In fact, attributes don't look like code because they aren't code. They're really code "decorations" that supply extra information related to the code to anyone or any process that cares. Generally, these attributes are useful to entities that manipulate code and objects in interesting wayssuch as Visual Studio's Properties window, the debugger, and XML serializers.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!