In CQRS, should my read side return DTOs or ViewModels?

前端 未结 4 1153
太阳男子
太阳男子 2020-12-23 16:59

I\'m having a debate with my coworkers in the design of the read side of a CQRS application.

Option 1: The application read side of my CQRS applicat

4条回答
  •  萌比男神i
    2020-12-23 17:39

    One of the primary principles of DDD/CQRS is that you shouldn't be editing the view model. Instead, task-based screens should guide the user towards issuing explicit commands. If you can't come up with task-based screens, you should be using a different form of CQRS like the one I describe here:

    http://udidahan.com/2011/10/02/why-you-should-be-using-cqrs-almost-everywhere/

提交回复
热议问题