Wednesday, October 08, 2003 6:24 PM Jan Tielens

New Article: Using Custom Attributes for Validation

Today my new article on MSDN Belux went online.

<quote author=“MySelf“>
Attributes can be used to decorate language elements with additional information that can be retrieved at run time by using Reflection. You can easily build your own custom attributes to create powerful generic solutions. At first sight they might to seem a little bit useless. But this article shows how they can be used to create a simple extensible framework to provide validation of property values.
</quote>

Quoting yourself, how “geek“ is that? :-) Thanks Tom for the layout and publishing.

Comments

# re: New Article: Using Custom Attributes for Validation

Wednesday, October 08, 2003 5:20 PM by Bernard Vander Beken

It's very geeky - just beware of the dangers of recursive self-quotations in a stack-based world ;)

# re: New Article: Using Custom Attributes for Validation

Thursday, October 09, 2003 2:05 AM by Pascal Naber

Clements Vaster of Newtelligence has already implemented this kind of attribute based validation more than a year ago in their SDK. They call it constraints and have implemented 20 constraints. (with sourcecode)
http://staff.newtelligence.net/clemensv/CategoryView.aspx?category=Talks%7CTechEd%20Malaysia

# re: New Article: Using Custom Attributes for Validation

Thursday, October 09, 2003 1:58 PM by Jan Tielens

Yes, I'm aware of that! Many examples of the technique that I showed are available on the net. I just used the validation example to illustrate the use of attributes (which was the goal of this article). So I do not want to pretend I "invented" the technique, I just used it to explain attributes.

# re: New Article: Using Custom Attributes for Validation

Monday, October 13, 2003 7:48 AM by Clemens Vasters

Sure I did implement this already, but I didn't write an MSDN article. ;)