Architecture
Data Objects
Different types of data flow between different parts of the application. Your application may use
- Raw data - data obtained in its raw form from a database, file, service, etcetera. The data source formats it into an object to be passed back to the repository
- Entities - data obtained from data sources
- Data Transfer Objects (DTOs) - data abstracted/restricted before being passed out of the Data Layer
- State - data prepared for use in the user interface
A typical flow of data might look like
flowchart RL
subgraph User Interface Layer
vm[View Model] -->|State| ui[User Interface]
end
repo -->|DTO| vm
db[(Database)] -->|raw| ds
subgraph Data Layer
ds[Data Source] -->|Entity| repo[Repository]
end
flowchart RL
subgraph User Interface Layer
vm[View Model] -->|State| ui[User Interface]
end
Data
data -->|DTO| vm
repo -->|DTO| data
db[(Database)] -->|raw| ds
subgraph Domain Layer
direction TB
data[Data]
uc[Use Case]
end
subgraph Data Layer
ds[Data Source] -->|Entity| repo[Repository]
end