Biz property needs to be validated against database

Topics: Validation Application Block
Feb 20, 2008 at 2:13 AM
Please see the following the example.

I have a class,

Class: Member
Property: EmailAddress

The property EmailAddress above needs to be validated against the data in database to ensure the uniqueness. In this scenario, I can use self validation concept on Member object to validate the email address and of course I need to connect to database.


Again, I have another class

Class: AdminUser
Property: EmailAddress


Once again, the property EmailAddress needs to be validated against the data in database to ensure the uniqueness. In this scenario also, I can use self validation concept on AdminUser object to validate the email address and of course I need to connect to database.


Here are my queries:

1. In these scenarios, where validation requires database interaction, should I implement Self Validation concept on the Biz object and write code to validate data with database?
2. Here, the validation is duplicated, how can I reuse the code?

Feb 27, 2008 at 2:27 AM
No response from anyone so far, is this site alive!