Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Design Data Model Layers #110

Closed
tsmaeder opened this issue Aug 11, 2016 · 0 comments
Closed

Design Data Model Layers #110

tsmaeder opened this issue Aug 11, 2016 · 0 comments

Comments

@tsmaeder
Copy link
Contributor

We currently have two different representations of entities: one in the REST API, usually defined as MediaTypes, and one in the "models" package.
The representation in the REST API is generated, and thus restricted to what can be expressed in the Goa DSL. Also, it is mixed in with stuff that is purely used for implementing the REST API (request payloads, for example)
The representation in the models package is used to store stuff in the database with Gorm. As such, it is not as expressive as we would like: for example, because JSON does not know a "DateTime" type, we are storing dates as integers in order to be able to do range queries on them (select from wi where created > '2016-01-01')
The question now is whether we should introduce an intermediate layer ("domain layer") where entities are represented in a manner that is both convenient and independent of REST or storage

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

No branches or pull requests

3 participants