-
Notifications
You must be signed in to change notification settings - Fork 26
Description
See issue resthub/resthub-spring-stack#45 for the server part.
How should we consider support for:
- JSON references - (de)serializing object graphs and preventing duplication or circular references, using references.
- Hypermedia - adding metadata to serialized objects to allow lazy loading through additional API calls on the client side.
We should consider only one of those options.
JSON reference
On the client side, several libs achieved this:
There are problems on the server side: Jackson doesn't support the json-ref syntax "$ref" and only relies on having typed objects on both client/server sides (see ObjectIdentity).
There are also problems on the client side; javascript client libs duplicate data, i.e. they expand the object graph with their values. This can be problematic when updating data on the client side.
Hypermedia
We could consider HAL and/or json-ld formats and integrate those on the client side for lazy-loading and metadata.
We could integrate those within backbone using:
- backbone model getters/setters
- proxies using ES6 Proxy API
Of course, I'm all for Hypermedia!