Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read models vs. View models #43

Open
webdevilopers opened this issue Jul 29, 2020 · 2 comments
Open

Read models vs. View models #43

webdevilopers opened this issue Jul 29, 2020 · 2 comments

Comments

@webdevilopers
Copy link
Owner

webdevilopers commented Jul 29, 2020

Came from:

/cc @matthiasnoback @ashishkpoudel @cherifGsoul @stemmlerjs

Just finished reading your "Web Application Architecture" book @matthiasnoback . I finally understood the difference between READ and VIEW models. In your chapter about layers you suggest to put VIEW models into the application layer. But where to put the READ models?
Since in #CQRS for instance a read model represents the state of the write model, some people state it should belong to the domain layer. I agree VIEW models are optimized for presentation and should live elsewhere. E.g. application or as we like to add a "presentation" layer.

@matthiasnoback states:

I'm not sure if the distinction between read and view model is a very common one. For a view model is used to expose data to actors (e.g. users). A read model exposes data to the system itself (i.e. it's for internal use). It makes sense to put that one in the domain layer.

Related:

@webdevilopers
Copy link
Owner Author

webdevilopers commented Jul 29, 2020

Similar question by @cer:

Another #eventstorming question: Read Models are typically depicted as being consumed by humans. But arguably a command triggered by, for example, a policy needs a "Read Model". Thoughts ?

/cc @ziobrando @tPl0ch

@tPl0ch states:

I personally don't like the term read model. The important part is the decision that is taken, either by a policy or a human, and that the decision can be taken locally. To do this all the required information needs to be present. So maybe decision model would be a better name?

@ziobrando states:

Yep, totally on you on the rationale. Don’t know if that’s a compelling reason for a name change #Lazy. I just say “a read model is a decision support tool” ...decision model could be misinterpreted in some other ways, I am afraid.

@cherifGsoul
Copy link

I had always considered Read Models and View Model the same, they are just object to carry data to UI layer where the later can format those data for presentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants