question about serialization


T

Tobi

I'm prepping for the SCJP, and am for the first time playing with
serialization. I was wondering for what cases would serialization be
used, as preferable to storing stuff in a database? I've never seen
it used any place that I have worked. Is it commonly used? Or is it
more common with apps that aren't web based?

Thanks.

Tobi
 
Ad

Advertisements

S

Silvio Bierman

Tobi said:
I'm prepping for the SCJP, and am for the first time playing with
serialization. I was wondering for what cases would serialization be
used, as preferable to storing stuff in a database? I've never seen
it used any place that I have worked. Is it commonly used? Or is it
more common with apps that aren't web based?

Thanks.

Tobi

That depends. Database use can be roughly divided into two categories:

1) Providing structured, secured an (for most practical purposes)
standardized access to structured data.
2) Serializing object values/states with the sole purpose of restoring
them at a later point in time.

Use case 1) is where relational databases where invented for and can by
no means be compared to object serialization in Java. In this situation
the database is one of the core deliverables as well as the integration
point where custom applications and generic analysis and reporting
tools, backup tools etc. can be linked together.

Use case 2) is a heavily stylized way of (mis-) using a relational
database as a storage medium for object states. Numerous ORM tools exist
to help automate this.

To make matters worse people who do not know the difference tend to mix
both use cases inside the same physical database.

Besides a lot of minuses and pluses use case 2) can be similar to object
serialization.

Regards,

Silvio Bierman
 
M

Mark Space

Tobi said:
I'm prepping for the SCJP, and am for the first time playing with
serialization. I was wondering for what cases would serialization be
used, as preferable to storing stuff in a database? I've never seen
it used any place that I have worked. Is it commonly used? Or is it
more common with apps that aren't web based?


I haven't seen any actual use for serialization either. However I could
speculate on some uses.

1. Data protocol over wire (TCP)
2. Save file function
3. Encode/Decode XML file
4. Transfer objects between servers

I'd like to know also if anyone makes heavy or even occasional use of
serialization.
 
Ad

Advertisements

R

Roedy Green

RMI uses Serializable.

Lotus did a office suite that made great use of it. The idea was you
could stop the app at any time and pick up right where you left off.
It serialized the state of the entire office suite. Unfortunately
they discontinued it.
 

Top