what is serialization and how it works

Posted by Rozer on Stack Overflow See other posts from Stack Overflow or by Rozer
Published on 2010-06-07T09:39:29Z Indexed on 2010/06/07 9:42 UTC
Read the original article Hit count: 166

Filed under:
|

I know the serialization process but have't implemented it.

In my application i have seen there are various classes that has been implemented serilizable interface. consider following class

public class DBAccessRequest
implements Serializable
{
    private ActiveRequest request = null;
    private Connection connection = null;
    private static Log log = LogFactory.getLog(DBAccessRequest.class);

    public DBAccessRequest(ActiveRequest request,Connection connection)
    {        
        this.request = request;
        this.connection = connection;
    }

    /**
     * @return Returns the DB Connection object.
     */
    public Connection getConnection() {
        return connection;
    }

    /**
     * @return Returns the active request object for the db connection.
     */
    public ActiveRequest getRequest() {
        return request;
    }
}

just setting request and connection in constructor and having getter setter for them. so what is the use of serilizable implementation over here...

© Stack Overflow or respective owner

Related posts about java

Related posts about serialization