cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject ROP, LinkRest, JSON patch
Date Wed, 04 Mar 2015 08:50:30 GMT
BTW, I finally looked closer at JSON Patch [3], and it works quite differently from our normal
ROP commit. It does not identify objects in commit by ID. Rather it references each change
by path relative to resource root (such root can be a single object identified by id, or maybe
some object collection). 

It actually makes security easier (a weak point in ROP), but limits multi-object commit to
a fully connected graph. So I am not yet sure whether we'd try to marry it to Cayenne somehow,
or just invent our own protocol for commits. Perhaps we do both, as updating individual objects
via PATCH and JSON Patch is still better than sending the entire state with PUT. And for client
ObjectContext commits we'll use a different protocol based on explicit IDs.

Andrus


> On Aug 31, 2014, at 6:26 PM, Andrus Adamchik <andrus@objectstyle.org> wrote:
> 
> After a marathon of 5 LinkRest [1,2] releases in the last 20 days, I am starting to think
it soon might become capable enough to replace Hessian in ROP. Which is going to be awesome,
as the same server will be able to work with either Swing/SWT or JS clients, and ROP may break
out of its current shrinking niche.
> 
> Aside from the protocol details, the biggest architectural difference between current
ROP and LinkRest is that the later is not based on blind serialization. Instead it has a well-defined
query API that the client would have to follow. SelectQuery, RelationshipQuery, ObjectIdQuery
will all be easily translatable to LinkRest. As well as commits (after PATCH [3] is implemented).
Some consequences of the above:
> 
> * A LinkRest server can have fine-grained security. To a point of shaping the response
objects and attributes per user role. We’ve done that already on a number of real projects.
> * A LinkRest server can be upgraded without upgrading all the clients. E.g. we can use
newer Cayenne version on the server and the client wouldn’t know.
> 
> I am working on improving LinkRest now, and don’t have immediate plans to jump on the
ROP adapter for that, but still wanted to gauge interest in such a technology. And of course
in a wider LinkRest discussion. 
> 
> Andrus
> 
> 
> [1] https://github.com/nhl/link-rest
> [2] https://twitter.com/andrus_a
> [3] https://github.com/nhl/link-rest/issues/39

Mime
View raw message