The classes define the blueprint that consists of the methods and behavior of a particular structure. The classes are:
The conditions that has to be kept in mind while using serialization is that:
To create a class serializable there is mechanism of serializing an object on the client code. There are four things that are required to make a class serializable and these are:
The implementation is the easy phase of the serializable class. At first this interface remains as an empty interface and it declares no methods or behavior at all. It has additing feature that is added to the implements serializable class to follow the class declarations. It is not required to make every object as serializable as there will also be some classes that might not be having any serialization required. For example, an instance of a file that actually represents a file gets created by using
File file = new File("c:\\career\\ride");
so to make this work there is no surity that is it require a serialized code to be written. The file class is having a different lifecyle than the serialized data and modification in it might remove the entire information. There are also platform dependencies that involves native code not used for serialization.
RMI consists of a server and a client program. The application in RMI creates a number of remote objects that makes the references to the objects that are to be accessible. This way when a client makes a call to the method on remote objects then the reference is passed to one or more remote objects in server. It then invokes certain methods on them to provide few functionalities. RMI provides the mechanism to communicate and pass the information from one part to another using the distributed object applications. It requires to locate the remote objects so that the registry can be maintained for the remote objects with RMI's naming facility, rmiregistry, and the application that can pass the remote object references and return it as a normal operation.