C
C
csharpnoob2017-07-26 19:06:31
Software design
csharpnoob, 2017-07-26 19:06:31

Application architecture question (CQRS)?

In all my previous projects, I have used a typical 3-tier architecture.
I'm currently developing a REST API (ASP.NET Core) and after a lot of thought I decided that I would use CQRS. But I still have a few questions related to the abstraction from the data warehouse (and its need in general) and models.
I plan to split the project into small libraries, each of which is responsible for a certain functionality. For example, there is a library for working with users, it contains a set of Command and Query. Can I directly write queries in this library and pull the database, or do I need to somehow abstract from the data warehouse?
Question with models: earlier in projects I made models that fully corresponded to the structure in the database. If I understand correctly, you don't need to do this in CQRS. In my understanding, you need to write a separate class for each Query, which the Query will fill and return. Right? Or am I confusing something? Do we need View models in this case? After all, it turns out that Query will return only the data we need.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Silin, 2017-07-26
@byme

Question with models: earlier in projects I made models that fully corresponded to the structure in the database. If I understand correctly, you don't need to do this in CQRS.

How are you going to restore the state of a Query from a long-lived store?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question