GithubHelp home page GithubHelp logo

Comments (3)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 4, 2024
I can confirm this issue. I also have an object model that has some cycles, 
mainly referencing parent relations. I was able to overcome the issue with 
generating the RuntimeSchema (see below) but then I ran into issues when 
serializing the data, since the recurring objects have not been detected as 
references but have been serialized again and again. Is the lack of support for 
cyclic object models a known limitation? Is it planned to support such 
references? That would be great.

Regarding the runtime schema generation, here is what I did: I added a 
getSchemaPlaceholder method to RuntimeSchema, which mainly duplicates the code 
of getSchema, but returns directly the HasSchema<T> object. This object is then 
used in RuntimeFieldObject's FieldFactories for MESSAGE and POJO, so that the 
child schema is not fetched during creation of the parent schema. Thus the 
creation is deferred and the stackoverflow does not occur. The drawback is that 
the validation is also deferred and happens then during the serialization.

Original comment by [email protected] on 19 Jan 2011 at 3:04

from protostuff-googlecode-exported.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 4, 2024
Nice timing.  I've been working on this the past few days.
This feature is now available on trunk.
Let me know if that works for you.
Take a look at http://code.google.com/p/protostuff/wiki/SerializingObjectGraphs

@tvanles Yep that's the route to go (w/c I took) to support cyclic 
dependencies.  

Thanks





Original comment by [email protected] on 19 Jan 2011 at 5:08

  • Changed state: Fixed

from protostuff-googlecode-exported.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 4, 2024
I'll make a release soon.  Would be good if you can verify.
Next on the roadmap (for next release) would be support for java.util.Map

Original comment by [email protected] on 19 Jan 2011 at 5:17

from protostuff-googlecode-exported.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.