In my last screencast I talked about integrating the Data Access Application Block with Unity:
In the following screencast on the Validation Application Block in Enterprise Library 4.0:
we don’t need to discuss Unity Extensions like in the previous screencast, because we can get really nice injection of validator classes, such as IValidator<Customer>, into our custom classes by creating a simple wrapper around the Validation Application Block and registering the wrapper with Unity.
The screencast shows how to create a simple wrapper around the Validation Application Block, register it with Unity.RegisterType, access the custom validator classes via Unity.Resolve, and have Unity inject those validator classes into custom classes, such as an AddCustomerPresenter Class. The same techniques will work if you are using the ASP.NET MVC Framework and injecting validator classes into a Controller.
For more information on the Validation Application Block:
- Validation Application Block in Enterprise Library 3.0 – Using Validation Facade Class – Part I
- Validation Application Block in Enterprise Library 3.0 – ValidationFactory Class – Part II
- Validation Application Block Ruleset in Enterprise Library 3.0 – Enterprise Library 3.0 Tutorials – Part III
- Validation Application Block – Rules in External XML Configuration File – App.Config Web.Config – Enterprise Library 3.0 – Part IV
You can also check out my Unity Dependency Injection Screencasts:
Thanks for all the positive feedback on the previous screencast Enjoy!