I was involved in an interesting debate about the visibility of domain models & was wondering if people here have any good guidance.
- Per my understanding of MDA, we need not expose the domain model throughout the application layers & tiers
- The reason being that any change to the domain model has an impact in the overall application
- The wise thing to do would be to expose light-weight object (DTO's) which are a small sub-set of the domain model to abstract the actual model
- On the flip side, any change to the domain model would mean changing various DTO's throughout the application for the change to be visible, while if we do expose the domain model, then the change is in a single location
Hope to see some comments & thoughts about this.
Appreciate all the help!