Business object validation
23 October 2006 in .Net, Code | Comments enabled

This long weekend I’ve been doing a fair bit of coding and catching up on some tech reading online in the domain of business objects, testing and WPF development. I managed to find my way to an article on The Code Project which discusses the use of interface I hadn’t heard of before – IDataErrorInfo and goes into some detail on how to write what I consider to be some rather clever validation code for your business objects.

The error information provided by an object implementing IDataErrorInfo is automatically picked up by controls that the object is bound to (for example, if the object has an error based on the data entered the control will automatically notify you about the error without you, the developer, having to explicitly wire it up). I won’t go into too much detail about IDataErrorInfo since it is covered in the article and has links to MSDN as well with more information.  

Paul’s article goes into further detail about implementing the business rules for validating business objects. The implementation discussed made a lot of sense and looked quite elegant, I will certainly be looking to follow this design with any business object design I’m doing in future.

Paul Stovell, the article author, has a great blog as well which he posts about WPF and some more interesting topics of .net.

Code Project Article: Delegates and Business Objects

 - JD


3 comments. Add your own comment.

/\ndrew says 23 October 2006 @ 21:38

Hey JD,

Take a look at CSLA for a very nice implementation of .NET business objects.

A.

traskjd says 24 October 2006 @ 08:19

Thanks for the comment Andrew. I did do some reading about CSLA after reading that article (as it is mentioned that it is the basis for that implementation discussed – even though the implementation only covers rules).

I think I have another book to buy :)

– JD

Paul Stovell says 24 October 2006 @ 12:14

Hi Andrew,

I’m glad you enjoyed that article. Rocky’s CSLA books are great, especially if you want to go deep into distributed architecture and design.

Cheers

Leave a Comment

Name (required)

E-mail (required - not published)

Website

Your comment: