cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: 4.1 templates with relationships
Date Wed, 18 Jul 2018 13:31:46 GMT

> On Jul 18, 2018, at 4:19 PM, Andrus Adamchik <andrus@objectstyle.org> wrote:
> 
> 
> 
>> On Jul 18, 2018, at 4:04 PM, Maik Musall <maik@selbstdenker.ag> wrote:
>> 
>>> 
>>> BTW, with your Gson serialization, how do you deal with controlled serialization
of essentially infinite graphs? Do you provide a spec of how deep to go down the relationships
path?
>> 
>> I don't have that problem in my experimentation project because I can use an ExclusionStrategy
there that solves it. If actual cyclic references need to be expressed, I guess that would
be a custom solution with semantics encoded in JSON that the consumer on the other end would
need to know about. But I'm not trying to serialize my entire database to someone :)
> 
> I was asking as LinkRest provides essentially such framework / semantics. And it is far
from trivial on the backend.

[Sorry didn't finish my thought... ]

Periodically someone would ask "how do I serialize Cayenne objects to JSON". Which to me means
"is there a JSON serialization library without the complexity of LinkRest that produces readable
JSON and allows to control serialization depth". But maybe I am overthinking it and typical
use cases are simple and can be handled with ExclusionStrategy or a similar simple rule set.

If you can make GSON work, you should post an example somewhere. This seems like a popular
question. 

Andrus


Mime
View raw message