Read model per bounded context
cqrs, domain-driven-design
Solution
Your read models don't belong to any bounded contexts, they are produced by some domain objects in some bounded context. But they are a separate component of your system.
Your bounded context shouldn't need any read model. Read model is an output of the domain, not the input. If you need 2 BC communicate, use events, not read models. Read models are for GUI/reporting, not for processing business rules.
Problem
i have a question related to read models in cqrs. Assume we have two bounded contexts: A and B In context A we build a readmodel based on the events from context A. We have some kind of dao to access the readmodel in A. Now assume that B needs the same read model as A. As far as i understood, bounded context shouldn't depend on each other. So how can i use the model from A. I see three possiblities to solve this Create an API Module for the read model in A and use this in context B (Would be a dependency between A and B) Create an seperate read model in context B thats exactly the same as in A (Would result in code duplication) Create a service facade (REST or SOAP or whatever) in B that is accessible from A to provide the read model (possibly the service doesnt provide exactly the data needed)