Study your flashcards anywhere!

Download the official Cram app for free >

  • Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

A key: Read text to speech.a key

image

Play button

image

Play button

image

Progress

1/19

Click to flip

19 Cards in this Set

  • Front
  • Back
What are the requirements for a method that responds to the Deserialized Event?
Returns void
accepts a StreamingContext object as parameter
What classes can you use when serialized data is to be consumed by applications running on a unix based OS?
SoapFormatter
XMLSerializer
What is Serializing?
The process of converting an object into a linear sequence of bytes for storage or transfer. User for clipboard copy as well
List the steps to serialize a string
1. Create a FileStream to store the serialized object
2. Create a BinaryFormatter
3. Call the BinaryFormatter.Serialize() by passing the FileStream object and the object to serialize
What is a fixup during Deserialization?
Explain Backward Reference and Forward Reference
If a deserialized object refers to another object the Formatter queries the ObjectManager. If the refered object has already been deserialized its called Backward Reference, if not it is a forward reference and gets a FixUp at the end of deserialization
What is necessary to mark a class Serializable?
Add the attribute [Serializable]
What member shouldn't be serialized and how can it be declared?
Calculated members of class as they use unnecessary space.
Add the Attribute [NonSerializable] to the class
What is to consider with non serializable members?
They are not initialized.
Use the IDeserializationCallback.OnDeserialization method to initiliaze that member
What is an optional field and how to declare it?
[OptionalField]
The runtime will not throw an exception if a member was not serialized.
What are the best ways for Version compatibilty | Serialization?
- Never remove a serialized field
- Never add a [NonSerialized] to field that was not applied before
- Never change a name of a field
- when adding a new field add [OptionalField attribute]
What are the two Formatter object and describe them.
1. BinaryFormatter, most efficient but can only be used in an .NET environment
2. SoapFormatter, succesful through Firewalls, all Platforms, uses XML BUT consumes 3-4 more space than the BinaryFormatter. NO 1.1 to 2.0 support
Why use XML Serialization?
Greate interoperability, more administror-friendly,
What restrictions does XML Serialization have?
Can only serialize public members and cannot serialize object graphs
List the steps to serialize a DateTime object
1. Create a FileStream to hold the object
2. Create an XMLSerializer object
3. Call the XMLSerializer.Serialize method
What features must a class have to be XML serializable?
- members to serialize must be public
- parameterless constructor
How are members serialized?
Member are XMLElements but can be configured using XMLSerialization Attributes
What Interface is to implement to take complete control over XML Serialization?
IXmlSerializable
What tool creates a set of class that are strongly typed?
xsd.exe
What can be serialized by an XMLSerializer?
Datasets, arrays, collections, and instances of an XmlElement or XmlNode class
can all be serialized with XmlSerializer.