While maintaining my open-source libraries Spargine, I needed a way to keep track of who added a method or class and why, along with other relevant information such as the creation date, description, unit and benchmark test status, and more. To address this need, I created an attribute called InformationAttribute. Initially, I wasn’t sure if it would be useful, but after using it for a few years, it has become invaluable in helping me maintain these libraries.
In this article, I will describe in detail how I use InformationAttribute in Spargine. I hope that your team will find this attribute useful in your projects. Below is a description of the properties in InformationAttribute.
| Property | Description |
| Author | Name of person who originally added the class or member. |
| BenchMarkStatus | Status of benchmark tests if any. Values are None, Benchmark, Completed, CheckPerformance, NeedsUpdate, NotRequired, WIP (work in progress) |
| CreatedOn | The date the class or member was added. |
| Description | Description of the class or member. |
| Documentation | URL to information for the class or member. |
| ModifiedBy | Name of the person who last modified the code. |
| ModifedOn | Date when code was modified. |
| OptimizedStatus | Status of benchmark tests if any. Values are None, Benchmark, Completed, CheckPerformance, NeedsUpdate, NotRequired, WIP (work in progress) |
| Status | Status of the class or member. Values are Status of the class or member. Values are NotSet, New, Available, NotUsed, Updated, NeedsDocumentation |
| UnitTestStatus | Name of the person who originally added the class or member. |
Examples of Use
Below is how I typically use InformationAttribute for a class.
Here are examples of how I use this attribute for class members.
The InformationAttribute streamlines my workflow by helping me quickly identify tasks that require attention. I regularly query properties such as BenchMarkStatus, OptimizationStatus, Status, and UnitTestStatus to prioritize tasks, including documentation.
Summary
First, if you feel this attribute could be useful in your projects, please email me at dotNetDave@live.com with your suggestions or comments. Alternatively, you can post an issue in the GitHub repository for Spargine. I will add your suggestions to this attribute as soon as I can.
Secondly, if I know that more people are using this attribute besides myself, I would like to work on a few things. I’d like to figure out a way to update some of the properties like ModifiedBy, ModifiedOn, Status, and more. I’d also like to figure out how to turn the attribute information into a document.
I’m looking forward to hearing from you.
Pick up any books by David McCarter by going to Amazon.com: http://bit.ly/RockYourCodeBooks
Make a one-time donation
Make a monthly donation
Make a yearly donation
Choose an amount
Or enter a custom amount
Your contribution is appreciated.
Your contribution is appreciated.
Your contribution is appreciated.
DonateDonate monthlyDonate yearlyIf you liked this article, please buy David a cup of Coffee by going here: https://www.buymeacoffee.com/dotnetdave
© The information in this article is copywritten and cannot be preproduced in any way without express permission from David McCarter.
Discover more from dotNetTips.com
Subscribe to get the latest posts sent to your email.




