PrepAway - Latest Free Exam Questions & Answers

Which two actions should you perform?

You are defining a class named Certkiller Class that contains several child objects.
Certkiller Class contains a method named ProcessChildren that performs actions on the child objects.
Certkiller Class objects will be serializable.
You need to ensure that the ProcessChildren method is executed after the Certkiller Class object and all its child objects are reconstructed.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

PrepAway - Latest Free Exam Questions & Answers

A.
Apply the OnDeserializing attribute to the ProcessChildren method.

B.
Specify that Certkiller Class implements the IDeserializationCallback interface.

C.
Specify that Certkiller Class inherits from the ObjectManager class.

D.
Apply the OnSerialized attribute to the ProcessChildren method.

E.
Create a GetObjectData method that calls ProcessChildren.
F.
Create an OnDeserialization method that calls ProcessChildren.

Explanation:
The IDeserializationCallback interface allows some custom code to be called after the complete object graph has been
deserialized via the onDeserialization method.
In this case the ProcessChildren should be called in the onDeserialization method.
Applying OnDeserializingAttribute to the ProcessChildren method will not work because there is not guarantee that the complete object graph will have been deserialized.
If the Certkiller class inherits from ObjectManager it will still have to implement iDeserializationCallback to perform actions after the complete object graph has been deserialized.
The OnSerialized attribute signifies that a method should be called immediately after serialization of the object.

One Comment on “Which two actions should you perform?


Leave a Reply