13.15. Attributes

Some object-oriented texts use the word attribute to represent a data member in a class. We've been using the term field because attribute has a very specific meaning in .NET. Although we don't make use of this .NET attribute in building the SRS, we want to at least provide a brief description of a .NET attribute.

A .NET attribute is a reference type that derives from the System.Attribute class and is used to assign metadata tags to other programming elements—that is, descriptive information about such elements.

An attribute can be applied to any code element (class, constructor, delegate, method, field, and so on) by placing the name of the attribute in brackets before the code element. For example, the System.Array class ...

Get Beginning C# 2008 Objects: From Concept to Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.