Re: Reducing the size of a serialized object.



Having done a little research on the web and found lots of pages on Java
Serialization I find that the best place to look is the JavaDoc's
introduction to the: ObjectOutputStream.

>From lines like:

" The default serialization mechanism for an object writes the class of the
object, the class signature, and the values of all non-transient and
non-static fields. "

I am assuming that when it says "writes the class of the object" that it
does not write the .class file but rather just a string saying what the
class is called.

This would mean that my adding 3 big methods would only add 3 more strings
(their signatures) to the traffic on the line. This I can live with.

Thanks,

Andoni.


"Andoni" <no_spam_please@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>

> Hello,
>
> I have an RMI server that takes certain actions on a bean that is passed
to
> it. Because a lot of beans are being sent over the wire to the RMI server
> every day I want to try to keep down the size of the serialized bean.
>
> I am not using a web server or class server to download stubs but instead
I
> just put a copy of all classes (and stubs) on each machine at deployment
> time so that the only thing that needs to be passed over the wire is the
> data in the bean. Now I have a decision to make. I want to add 3 big
methods
> to the bean because they should be part of this bean for the program to be
> very OO compliant. I want to know, will this increase the amount of data
> that has to be sent over the wire?
>
> In short: are the methods of a serialized bean also serialized in some way
> or is it only the data contained in the object or is it the data and the
> method signatures?
>
> Thanks in advance for any and all help,
>
> Andoni.
>
>


.



Relevant Pages

  • XML <-> Bean serialization
    ... however what if I wanted to store my bean ... object in XML format in a database on the serverside? ... JAX-RPC layer uses for its webservices. ... was SUN's java.beans.Encoder class but this serialization is NOT the ...
    (comp.lang.java.help)
  • Re: AbstractTableModel not compatible with Swing
    ... I have the feeling that the OP may have been sidetracked by the mention of Serialization. ... If beans persist as XML, then there's no direct database connectivity, it almost seems. ... I see no point in serializing your Person bean to XML and then trying to store the XML into a traditional RDBMS. ... I'd use JDBC to directly store the Person bean as a record in a Person table. ...
    (comp.lang.java.help)
  • Serializing beans. Change in code makes old files unreadable.
    ... Another question about serialization. ... which I know I could write a test program to solve but... ... I have a bean that holds a lot of data and has a few methods. ... some confirmation before I go re-writing everything to fit this. ...
    (comp.lang.java.programmer)
  • Reducing the size of a serialized object.
    ... I have an RMI server that takes certain actions on a bean that is passed to ... Because a lot of beans are being sent over the wire to the RMI server ... are the methods of a serialized bean also serialized in some way ...
    (comp.lang.java.programmer)
  • Re: Reducing the size of a serialized object.
    ... Because a lot of beans are being sent over the wire to the RMI server ... > every day I want to try to keep down the size of the serialized bean. ... > Andoni. ...
    (comp.lang.java.programmer)

Loading