Cloning

What is Cloning? Why we are using Cloning concept? and How many types of cloning?

Questions by hanuman.gorla

Showing Answers 1 - 4 of 4 Answers

Narayana

  • Jul 6th, 2012
 

Cloning is the process of creating a copy of the server and the main server will send the request to appropriate server that has been linked with main server.

  Was this answer useful?  Yes

surendar

  • Jul 16th, 2012
 

Cloning is the process of creating duplicate copy with current object state.

We use this concept in real world like, eg: In Bike manufacturing company, we use cloning for creating same bike object,
after that we change just Bikes engine number so that another bike object is created with current object.

For this we have clone() method int Object class.

We have 2 types of cloning.

1) Partial cloning
2) Deep cloning

  Was this answer useful?  Yes

Cloning is used in some of the ares of the Web Projects. Consider one example we are trying insert some data into DB then what we will do is we are create one java object for that(See creating java object which makes to interacting with DB is very costly). So our job is done what generally we will do is will close the DB object. But after some time again we need to do another operation with DB i.e this time we are doing Update operation in DB but here also we need one common object from DB i.e none other that connection object of DB ryt.

So creating the same connection object multiple times is very costly process. In those situations we keep the clone connection object in cache so in future we need the connection object then we use this clone instead of creating the new connection object.

Another best example where we are using this clone object is for example we brought some data from DB and we did the calculations on that data the we displayed the results to the user but we need the different results i.e same data but different calculations in that case what we will do is we will keep clone data. So for future proposes we will do the different calculations on the same cloned data.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions