Question 31 – What is an Attribute?
Attributes are declarative tags in code that insert additional metadata into an assembly. Attributes are of Two types:
- Predefined attributes such as Assembly Version, which already exist and accessed through Runtime Classes;
- Custom attributes, which you write yourself by extending the System.Attribute class.
- Example – Custom Attribute for entire assembly
1. using System;2. [assembly : MyAttributeClass] class X {}
Question 32 – What is Serialization & DeSerialization?
It is a process of taking an object and converting into a form so that it can be transported across the network or can be persisted in the storage location. This storage location can be physical file, database or ASP.NET Cache. The form contains the state of the object so that by this format, we can construct the same object a later point in time, which is called De-serialization. When the object is subsequently de-serialized, an exact clone of the original object is created. Remoting and Web Services depend heavily on this process.
Question 33 – Where Serialization is used?
- Used to save session state in ASP.NET.
- Copy objects to the Clipboard in Windows Forms
- Remoting to pass objects by value from one application domain to another.
Question 34 – What are the types of Serialization available in .net?
Serialization of 3 types and are as follows.
- Binary Serialization : Light and compact used in Remoting
- SOAP Serialization : interoperable use SOAP and used in web Services
- XML Serialization : Custom Serialization
Question 35 – What is Binary Serialization?
Binary serialization is a mechanism which writes the data to the output stream such that it can be used to re-construct the object automatically. The term binary in its name implies that the necessary information that is required to create an exact binary copy of the object is saved onto the storage media.
[ad]
Question 36 – What are the Advantages & Disadvantages of Binary Serialization?
Advantages:
Object can be de-serialized from the same data you serialized it to. It has enhanced performance as it is faster and even more powerful in the sense that it provides support for complex objects, read only properties and even circular references.
Disadvantage:
It is not easily portable to another platform.
Question 37 – What is SOAP Serialization?
The SOAP protocol is ideal for communicating between applications that use heterogeneous architectures. In order to use SOAP serialization in .NET we have to add a reference to System.Runtime.Serialization.Formatters.Soap in the application.
Question 38 – What are the Advantages of SOAP Serialization?
The basic advantage of SOAP serialization is portability. The SoapFormatter serializes objects into SOAP messages or parses SOAP messages and extracts serialized objects from the message.
Question 39 – What is a XML Serialization?
XML serialization converts (serializes) the public fields and properties of an object or the parameters and returns values of methods, into an XML stream that conforms to a specific XML Schema definition language (XSD) document. XML serialization results in strongly typed classes with public properties and fields that are converted to a serial format (in this case, XML) for storage or transport. Because XML is an open standard, the XML stream can be processed by any application, as needed, regardless of platform.” Implementing XML Serialization in .Net is quite simple.
Question 40 – What are the Advantages of XML Serialization?
- Serialization is of XML based.
- Support for cross platforms programming.
- Easily readable and editable.
Disclaimer – F5debug Interview Questions & Answers Series:
You may recopy extracts from these pages (“the material”) to individual third parties website or to the local system internal websites for their personal information, but only if:
You acknowledge the www.f5debug.net as the source of the material. Such acknowledgment should include reference to the www.f5debug.net in the copy of the material and should also include the words ” © Karthikeyan Anbarasan, www.f5debug.net “. You inform the third party that these conditions apply to him/her and that he/she must comply with them.
No Comments
let me know when iphone 4s will come in Malaysia? and where I can buy it in Malaysia?
Hey there just wanted to give you a brief heads up and let you know a few of the images aren't loading correctly. I'm not sure why but I think its a linking issue. I've tried it in two different browsers and both show the same outcome.|