DEV Community

Discussion on: Separation of Concerns The Simple Way

Collapse
 
konung profile image
konung

Good post .

A couple of personal gripes I have with MVC that apply. I think MVC often breaks separation of concerns, when people follow it blindly.

  1. I don’t think it’s correct to call controller layer a presentation layer. I believe it causes people to use it inappropriately. It should be called a routining layer, because it should be responsible for routing requests and nothing more . Instead it often end up housing business rules, as well as bits of presentation - such as converting view data to JSON or XML
  2. Model layer should not be responsible for business logic except in most simple apps . It should be responsible only for data layer - ie ORM. Business logic normally benefits from being separated into ServiceObjects that are loosely coupled with the Model layer.