Demonstrating Attributes and Reflection in .NET
(Page 1 of 8 )
In this article, Todd Clemetson demonstrates how the combination of attributes and reflection can result in some flexible and powerful software...
Editor's Note: This article's code has been updated to work with the final release of the .Net framework.With the inclusion of Reflection and Attributes within the .NET framework, Microsoft has taken software development to a new level. In this article, we will look at how the combination of these two technologies can result in some generic and powerful software.
After an introduction to .NET Attributes, we look at two examples of attributes in action that, with some enhancement, can be utilized in your .NET programming project today: a generic database manager for managing objects, and a custom Bug Tracking attribute along with a sample viewer application.
Before we can explore the construction of both the generic database and bug tracking attributes, we need an understanding of what attributes are and how they are used.
For supplemental information to this overview, please see the MSDN help packaged in .NET.
To work with the code in this article, you will need the following tools: