Tuesday, May 1, 2012

Layer-Specific Models

There seems to be consensus that each layer should have its own model. In addition to the core Domain Model and the ViewModel, there's also the "Persistence Model." Comment from SO:

  1. The persistance library(s) may have a different model and I may have a view model on the experience library(s). Gregory A Beamer - http://stackoverflow.com/questions/7742858/ioc-and-interfaces
The Domain Model and Data Access libraries both define a class named Product. The Domain Product is the important class that encapsulates the Domain concept of a Product. The Data Access Product class is only an artifact of the Entity Framework wizard. It can easily be renamed or made internal.
Mark Seemann - Dependency Injection in .NET p50

PM is a property bag while DM is about business logic and behavior

http://www.mehdi-khalili.com/orm-anti-patterns-part-4-persistence-domain-model

No comments:

Post a Comment