• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

multiple serialization depths?

 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an application relying on serialization for persistent storage. Specifically, the app should be able to serialize at 2 different "depths" meaning that a "quick save" saves/reads only high level information while a "full save" saves the entire serializable structure of the class.
Does anyone know if this is possible - and if so, any general implementation ideas?
Thanks.
 
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi surasak
Can you give more details like what kind of information you have.
I am not able to visualize that you have one object and you want to partially serialize the state in 1st step and rest of it in 2nd step. Why one would need that?
Can we model this by breaking the single object into two separate objects- ToplevelInfo and WholeInfo (which contains ref to ToplevelInfo or extends it)? This way we can control serialization of two separately.
Also, we can implement Externalization in WholeInfo object and in its serializing methods read/write External just deal with the whole info as we already serialized ToplevelInfo in some previous step...
I hope I didn't missed your question.
Regards
Maulin
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you serialise an object all underlying data is serialised as well.
You would need to override the serialisation code to make it different.
 
reply
    Bookmark Topic Watch Topic
  • New Topic