Programming and Webmasters forum
HomeSearchRecent PostsLoginRegister Contact Us

Username  
Password
Announcing 14th Weekly Contest - From 25 July To 01 August.

Win every week on this forum.

Chek out How To Win?
 

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

serialisation process customisation

 
webmaster forum
vijay12  Offline
Contest Points: 100
 
Regular Coder
Posts: 67
Topics: 33
January 08, 2009, 11:48:04 PM

hello friends...... Can any of them suggest , How can I customize the seralization process? i.e. how can one have a control over the serialization process? thank you !!!
 
webmaster forum
polas  Offline
*
 
Hacker
Gender: Male
Posts: 1224
Topics: 78
WWW
January 09, 2009, 06:35:36 AM

Serialisation is where an object (or objects) is converted into a sequence of bits in order for it to be stored or transmitted. The bits can be unserialised at the other end to recreate the objects. Its actually quite a cool thing, and something very nice which Java provides (as do other languages, but its nice the way it is so built into Java.)

In order to override the default, your class can implement the Externalizable interface, there are two methods ( readExternal and writeExternal) which you will need to implement - have a look at java.sun.com/api . Certainly in some aspects the Java serialisation isn't all that great, I know for some Java HPC applications (however few there are) the programmers used their own serialisation and obtained a significant boost in performance.

Mesham Type Oriented Parallel Programming Language
Skydive in North East England
 
webmaster forum
megna73  Offline
Contest Points: 103
 
New Poster
Posts: 2
Topics: 0
July 20, 2010, 09:04:11 PM

Serialization's data format has two problems.  The first is all the class description information included in the stream.  To send a single instance of Money, we need to send all of the following:

    * The description of the ValueObjectclass
    * The description of the Moneyclass
    * The instance data associated with the specific instance of Money.

This isn't a lot of information, but it's information that RMI computes and sends with every method invocation.  (Recall that RMI resets the serialization mechanism with every method call. ) Even if the first two bullets comprise only 100 extra bytes of information, the cumulative impact is probably significant.

The second problem is that each serialized instance is treated as an individual unit.  If we are sending large numbers of instances within a single method invocation, then there is a fairly good chance that we could compress the data by noticing commonalities across the instances being sent.

Web Development Services
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC


Google visited last this page July 30, 2010, 01:47:51 AM

Valid XHTML 1.0 Transitional     Valid XHTML 1.0 Transitional