Enterprise Library Validation Block - Should validation be placed on class or interface?

Posted by Robert MacLean on Stack Overflow See other posts from Stack Overflow or by Robert MacLean
Published on 2009-01-19T08:26:18Z Indexed on 2010/04/30 18:27 UTC
Read the original article Hit count: 205

I am not sure where the best place to put validation (using the Enterprise Library Validation Block) is? Should it be on the class or on the interface?

Things that may effect it

  • Validation rules would not be changed in classes which inherit from the interface.
  • Validation rules would not be changed in classes which inherit from the class.
  • Inheritance will occur from the class in most cases - I suspect some fringe cases to inherit from the interface (but I would try and avoid it).
  • The interface main use is for DI which will be done with the Unity block.

© Stack Overflow or respective owner

Related posts about enterprise-library

Related posts about validation