File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object Graphs.

 
Yogendra Joshi
Ranch Hand
Posts: 213
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Henry Wong
author
Marshal
Pie
Posts: 20823
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic