How to use the VAB in 3 Tiers.Please help clarify.

Topics: General discussion, Validation Application Block
Jun 28, 2008 at 6:00 AM

Guys,
There is not doubt that the Validation block looks very good.However I am not sure how to implement it
It's all fine in a demo but implementing in a full blown Ntier scenario is a different story.

I have learnt in these years that when moving stuff around "keep it light"So the approach I am taking is to have
a light Object (entity) moving around and a full blown object (bizObject) in the business layer.

This is the scenario
Let's take my typical object "Customer"

I have 2 Assemblies.
MyCompany.Customer Assembly
     Customer(Full Blown business Object here I usual have all the business logic related to customer)

MyCompany.Customer.Entities Assembly(entity) 
 CustomerInfo (this is a light version with only getters and setters) travels around the Tiers.

We all know that validation should occur in all layers.You cannot leave your UI without having validated
your "form".But you dont want to do a "to and fro" to your business Server,you will kill the app in a distributed scenario.
  
I want to keep my CustomerInfo very light with not validation whatsoever,but I want to have all the validation
in the Customer Class including the VAB.

How can I do that?My UI Layer doesnt know anything about Customer ,it only knows about CustomerInfo.

How Can I do my UI Validation using this structure?
Do i need to add the VAB to both myCustomerInfo and Customer?

I really wanted to keep CustomerInfo really light with no validation occuring there?

Am I missing the obvious?
Or shall i use the Integration dll against my bloated business object and not have a light one?mmmmmm

Take for example the WebClient Factory or service Factory they have that kind of structure too.  MyCompany.BusinessEnties. MyCompany.BusinessLogic. Where do you put the VAB?

Please help!!!
How did you make it work in your app?