• 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

Object Graphs.

 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers ,

Today , I was going through our book K & B on the page 451 i.e the code which explains Serialization Mechanism of Java. First of all , I did not understand what it explains about Object Graphs , One thing i understood that one object refers to other and that object too has an referece to other.. Correct me if i am wrong..

Also , I was not clear when is the usage of defaultReadObject and defaultWriteObject done and yes , I noticed that there was also a method called writeInt() , Similarly for every primitive do we have an read and write method? for ex : readString , writeString etc...

Only this was the topic which i found was a bit touch for me to understand in this book... :-( Please help me. Thx in Advance.

Bert , Did you forget of making me a Ranch Hand or Bartender or anything else than a greenhorn ? :-) I have tried helping many peoples at (Java Beginner section).

Thanks in Advance

Yogendra Joshi.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Yogendra Joshi:
... Bert , Did you forget of making me a Ranch Hand or Bartender or anything else than a greenhorn ? :-) I have tried helping many peoples at (Java Beginner section)...


You're just a few posts away from becomming a ranch hand. (See Saloon Titles.)
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Marc , Thx for the info.. Atleast after the 30th , I'll be called Ranch Hand.. :-) And yes the important part , did you or any of our ranchers found a solution to my actual query above ?

Waiting for a revert.

Regards ,

Yogendra Joshi.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Today , I was going through our book K & B on the page 451 i.e the code which explains Serialization Mechanism of Java. First of all , I did not understand what it explains about Object Graphs , One thing i understood that one object refers to other and that object too has an referece to other.. Correct me if i am wrong..



A "graph" is simply a data structure where each node can have any number of references to other nodes. An "object graph" just means that you have an object that can refer to any number of objects.

Now why is this important to object serialization? Unlike other data structures like a linked list or tree, there is really no guarantee of a single path from a first node, or root node. It is possible, while traversing a graph, to return to an object, that has already been traversed.

To solve this, object serialization must keep track of which objects have already been serialized. And when it encounters such an object, the serialization protocol sends some kind of mark that refers to a previously serialized object. (note: the actual reference can't be used because it may be in a different location on the other side of the serialization)

Henry
 
Yogendra Joshi
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Henry ,

Thanks for your reply. Now i understood that my assumption and your nice explaination both are correct.

Thanks again ,

Yogendra Joshi.
 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic