1

In domain driven design, are MVC controllers supposed to be calling entities directly or just services?

user204588
  • 1,613
  • 4
  • 31
  • 50
  • Possible duplicate of [Is the Controller in MVC considered an application service for DDD?](https://stackoverflow.com/questions/18640450/is-the-controller-in-mvc-considered-an-application-service-for-ddd) – guillaume31 Sep 03 '18 at 07:56

1 Answers1

4

DDD specifies nothing about MVC. You could use whatever architecture you want as long as you follow the guidelines.

Regarding a possible use of the MVC with DDD, the controllers should act as a Presentation layer (in fact all M, V and C should be in the Presentation layer). This means that they should call an Application service that loads the Aggregate, send it the Command and then persists the changes, all wrapped in a transaction.

Constantin Galbenu
  • 16,951
  • 3
  • 38
  • 54