Answer
No. Method bodies do not hold any information
on the state of an object, so they are not needed
in order to save or restore the state.
Is this item
helpful? yes no
Previous votes Yes: 0 No: 0
|
|
Comments and alternative answers
 |
 |
Re: Serialization is for saving the state of an object...
krishna raj, Jun 22, 2004
But when a method is invoked on an object that has been serialized and sent across from another JVM, does this method invocation have to happen on the original object and not on the serialized object, thus involving a network call.
For Eg. let's assume a client/server scenario (either Sockets or RMI) with CustomerManager and Customer classes in the server. Only Customer class implements Serializable.
1. Client creates CustomerManager (gets a reference only since it is not serializable) and calls a create() method (assume) on CustomerManager to create a Customer.
2. The above call goes to the server and returns a Serialized Customer object to the client (via proxy/stub or whatever).
3. Client invokes getCustName() method on Customer.
Suppose this method returns the Customer Name in upper case.
Does this method invocation have to go back to the Server ?Does the client have the implementation of the method as part of the serialized object, so that the method can be executed locally ?
Is this item
helpful? yes no
Previous votes Yes: 0 No: 0
|
|

|
|
|
 |
|