Suppose such nlayer: mvc client <--> application layer <--> Domain layer <--> repository layer .
reposiroy layer : ef4 model is in this layer used for ORM.
Domain layer : the entities generated from ef4 model is in this layer. all business logic realize in this layer.
application layer: Show public interface to mvc client , and realize UnitofWork to coordinate domain layer's function.
My first problem is how can I use Attribute funtion which can be used by mvc for some useful function such as client validation, because in domain layer all entities code are generated from ef4 model automaticly , it's obvious that add Attribute to entity code is not a good way.
So I reform any viewmodel that used by mvc client and application layer . Then add Attribute on viewmodel's property members. As times go on, I add more and more viewmodel. The most terrible problem is some viewmodel are so complex , it's so difficult to map from or to domain entity (or entities) and so difficult trace the relationship between viewmodels.
View Complete Post