Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Cloneable versus Serializable

Posted on 2009-02-20
3
Medium Priority
?
359 Views
Last Modified: 2012-05-06
Could someone suggest that how much the performance will be impacted if Serializable interface is used to clone java objects.  org.apache.commons.lang.SerializationUtils provides a method clone() to clone any serializable object but it says its slower.  Any other alternative of cloning?  Not sure if there is any benchmark tool available for this?
0
Comment
Question by:fix2009
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Ajay-Singh
ID: 23698495
I would think clone to be faster than serialzable, as serilazation has
to walk through the object graph to store the state of the object. While
in cloning, the user can simply call other construtor to create a new
instance.
0
 

Author Comment

by:fix2009
ID: 23727873
So is there any other alternative of cloning an object other than clone() method?  I am actually looking for if I dont have to maintain clone method when new properties are added to the object.
0
 
LVL 23

Accepted Solution

by:
Ajay-Singh earned 1050 total points
ID: 23729625
I am not sure what you mean by alternative to cloning. But there are
other libraries like xstream, which also does serialization, and pretty
fast too
  http://xstream.codehaus.org/
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Suggested Courses
Course of the Month21 days, 7 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question