Multilayered architecture

Why use a multilayered architecture ?
Flexibility It's easier to understand, create, correct, upgrade a very specialized software component instead of a many-specialized one.
Crosscutting Concerns
http://msdn.microsoft.com/en-us/library/ee658105.aspx
Authentication
Authorization
Caching
Communication
Configuration Management
Exception Management
Logging and Instrumentation
State Management
Validation
Rich Domain vs Anaemic Domain
http://martinfowler.com/bliki/AnemicDomainModel.html
http://www.sapiensworks.com/blog/post/2014/03/26/Rich-Domain-Is-SOLID-Anaemic-Domain-Is-An-Anti-Pattern.aspx
Domain Objects vs Persistence Model (ORM Entities)
http://www.sapiensworks.com/blog/post/2012/04/20/Dont-Use-ORM-Entities-To-Model-The-Domain.aspx
http://www.sapiensworks.com/blog/post/2012/04/07/Just-Stop-It!-The-Domain-Model-Is-Not-The-Persistence-Model.aspx

Practical examples
ORM ids might differ the DO's identifier (if any).
In many-to-many relationships you might have methods to add an element to a collection and also to set the element's parent this object. This kind of ORM method might not exists/be necessary to DO (domain object).
ORM might need Formula properties but DO not.
ORM might need usage of @EntityListeners but DO not.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.