Announcing the launch of DotNetAttributes.Com!
DotNetAttributes is - as its name implies, a site dedicated to Attributes in .NET. In case you didn't know, attributes are little labels that you can apply to elements in .NET, like classes, assemblies, methods and more. Once attached to an element, you can retrieve and diagnose the elements at run-time to base your decision making logic on. If you're really new to attributes, be sure to check out the FAQs section of the site.
While there is documentation available in the MSDN library on most of the attributes, it's pretty much scattered throughout the library. Attributes are spread out over the framework, its assemblies and its namespaces, and so is the documentation about them in the library. To create a central location for everything you always wanted to know about attributes, I created www.DotNetAttributes.com.
Why? About one and a half year ago I ran into a blog post by Rick Strahl's about hiding ASP.NET controls from the toolbox. The solution to hide them from the toolbox was to apply a few attributes to the control's definition. In his post Rick said: "It really would be nice if there was one page that lists all the attributes that can be applied to a control, all the attributes that can be applied to a property, to events etc." I really liked that idea and it got stuck in my head for a long time, but I never had the time to actually do something with it. Until recently. I was working on a new ADO.NET Entity Framework application and all of a sudden I figured: it would be so easy to use the Entity Framework for a data model on attributes and then fill them with data that I can can gather by using reflection. It felt like I could do a bare-bones version in just a couple of hours.
And indeed, a couple of hours later I had a working model, a working - albeit very crude - reflection importer and a bare bones web site.
For a few weeks I spent some more time on the site and developed the following features:
- Import attributes from all assemblies in the Global Assembly Cache or ad-hoc DLLs
- Record assembly, namespace, and parent of each attribute
- Record attribute usage - that is, keep track of which attribute can be applied to which .NET element like classes, methods and so on
- Record visibility (scope) of each attribute, and whether they can be inherited or not
- Hook up to the MSDN documentation portal to get basic descriptions of the attributes (if available)
- Hook up to the MSDN documentation portal to get the framework versions supported (if available)
- A details page for each attribute with all the information available
- A sign up page that lets you sign up for an account so you can add your own code examples and relevant links
- An attributes page with an hierarchical view of all namespaces in .NET with their attributes
- Auto generated class diagrams (more on that in a later blog post)
- A search engine that lets you search attributes on a variety of properties, like name, namespace and usage
- A (growing) list of Frequently Asked Questions. Be sure to send in a question if you have one that's not on the list
The idea of the site is to give it to the community. This means everyone (with a valid account) can enter new code examples and relevant links for others to enjoy and learn from. I'll be adding my own descriptions, code and links as well, and I'll be moderating whatever is added to keep things focused and on-topic.
Currently, the site is in beta stadium and may be a bit flaky and buggy. I also need to fix up the design. If you find issues, or have suggestions to improve the site (design, availability of specific data, requests for namespaces), please let me know.
I'll be posting a bit more on this project in the near future, including a blog on how I auto generated the class diagrams. Stay tuned....
Where to Next?
Wonder where to go next? You can post a comment on this article.
Links in this Document
Talk Back! Comment on Imar.Spaanjaars.Com
I am interested in what you have to say about this article. Feel free to post any comments, remarks or questions you may have about this article. The Talk Back feature is not meant for technical questions that are not directly related to this article. So, a post like "Hey, can you tell me how I can upload files to a MySQL database in PHP?" is likely to be removed. Also spam and unrealistic job offers will be deleted immediately.
When you post a comment, you have to provide your name and the comment. Your e-mail address is optional and you only need to provide it if you want me to contact you. It will not be displayed along with your comment. I got sick and tired of the comment spam I was receiving, so I have protected this page with a simple calculation exercise. This means that if you want to leave a comment, you'll need to complete the calculation before you hit the Post Comment button.
If you want to object to a comment made by another visitor, be sure to contact me and I'll look into it ASAP. Don't forget to mention the page link, or the Doc ID of the document.
Please correct the following errors:
Unfortunately, something went wrong and your message or comments have not been submitted successfully.
There's a fair chance things broke down because you tried to post something that looks like HTML. Things that look like HTML include (X)HTML, obviously, XML, ASP.NET markup and c# generics syntax as all of them use the < and > characters.
If that's the case, try altering your message and remove anything that looks like an angled bracket. You can replace them with [ and ] for example so you can still make it look like HTML to some extend.
If, on the other hand, you were trying to spam this web site, I am pretty glad I caught you in the act and stopped you from doing so ;-)
Also, please don't use links in your posts; I had to block them to filter out most of the junk mail I am receiving.