Serializable, Externalizable Objects-Advanced Computer Programming-Lecture Handouts, Lecture notes of Advanced Computer Programming

This lecture handout was provided by Amrita Kapoor at Birla Institute of Technology and Science for Advanced Computer Programming course. It includes: Serializable, Network, Externalizable, RMI, JavaBeans, Security, Sensitive, Parts, Java, Remote, Method

Typology: Lecture notes

2011/2012

Uploaded on 07/13/2012

ekan
ekan 🇮🇳

5

(1)

72 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Serializable
The serialization of objects in Java allows you to make a byte sequence from any object that has
implemented the Serializable interface; it also allows you to turn that byte sequence back into an object.
The mechanism does not depend on the operating system, which means you can transfer objects via
your network and restore them at the other side of the wire.
With serialization, you can easily implement a so-called lightweight persistence, prolonging an object's life
beyond the life of the application. The serialization mechanism has been added into the Java language
for two reasons: (1) the JavaBeans mechanism uses serialization, and (2) remote method invocation
(RMI) allows you to automatically use objects located at another host in the network just like any local
objects.
Externalizable
There might be times when you have special requirements for the serialization of an object. For example,
you may have some security-sensitive parts of the object, like passwords, which you do not want to keep
and transfer somewhere. Or, it may be worthless to save a particular object referenced from the main
object because its value will become worthless after restoring.
docsity.com

Partial preview of the text

Download Serializable, Externalizable Objects-Advanced Computer Programming-Lecture Handouts and more Lecture notes Advanced Computer Programming in PDF only on Docsity!

Serializable

The serialization of objects in Java allows you to make a byte sequence from any object that has implemented the Serializable interface; it also allows you to turn that byte sequence back into an object. The mechanism does not depend on the operating system, which means you can transfer objects via your network and restore them at the other side of the wire.

With serialization, you can easily implement a so-called lightweight persistence, prolonging an object's life beyond the life of the application. The serialization mechanism has been added into the Java language for two reasons: (1) the JavaBeans mechanism uses serialization, and (2) remote method invocation (RMI) allows you to automatically use objects located at another host in the network just like any local objects.

Externalizable

There might be times when you have special requirements for the serialization of an object. For example, you may have some security-sensitive parts of the object, like passwords, which you do not want to keep and transfer somewhere. Or, it may be worthless to save a particular object referenced from the main

object because its value will become worthless after restoring.

docsity.com