Skip to main content

ReadModel

Definition

A Read Model is a model specialized for reads, that is, queries. Queries are performed to obtain the data needed by the client applications, so the returned type can be specifically made for the clients and it can simply be a JSON object. So a Read Model is a data structure for displaying information that is in some way based on a Write Model.

Examples

Declaring a ReadModel
  ReadModel TodoReadModel {
string id;
string title;
bool completed;
}

Syntax

Declaring a ReadModel
    ReadModel <identifier name with a ReadModel suffix> {
<parameters list separated with semicolon>
}

Further reading