Enhancing Class and Member Documentation: Leveraging InformationAttribute in Spargine for Improved Code Maintenance

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.

PropertyDescription
AuthorName of person who originally added the class or member.
BenchMarkStatusStatus of benchmark tests if any. Values are
None, Benchmark, Completed, CheckPerformance, NeedsUpdate, NotRequired, WIP (work in progress)
CreatedOnThe date the class or member was added.
DescriptionDescription of the class or member.
DocumentationURL to information for the class or member.
ModifiedByName of the person who last modified the code.
ModifedOnDate when code was modified.
OptimizedStatusStatus of benchmark tests if any. Values are
None, Benchmark, Completed, CheckPerformance, NeedsUpdate, NotRequired, WIP (work in progress)
StatusStatus of the class or member. Values are Status of the class or member. Values are NotSet, New, Available, NotUsed, Updated, NeedsDocumentation
UnitTestStatusName 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

One-Time
Monthly
Yearly

Make a one-time donation

Make a monthly donation

Make a yearly donation

Choose an amount

$5.00
$15.00
$100.00
$5.00
$15.00
$100.00
$5.00
$15.00
$100.00

Or enter a custom amount

$

Your contribution is appreciated.

Your contribution is appreciated.

Your contribution is appreciated.

DonateDonate monthlyDonate yearly

If 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.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.