Floating FB popout byF5debug

Interview Questions and Answers on .Net Framework, OOPS, ASP.Net, C#.Net, SQL Server, WCF Series – Part 4

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.

 

 

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.

About Author: Karthikeyan Anbarasan, Microsoft MVP (Most Valuable Professional) in ASP.NET/IIS Architecture. He is the Founder and Chief Editor of the www.f5debug.net website and has authored books on Windows Phone and Business Intelligence(SSIS). He is also a Passionate Speaker and a Blogger on Microsoft Technologies.

You can Join Me On: Facebook, Twitter, Google Plus, LinkedIn

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Recent Posts

Random Posts

Most Viewed

URL Shortner

Create your own short urls!!!

Site Counter

free counters

Disclaimer

This is a personal weblog. The opinions expressed here represent my own and not those of my employer. For accuracy and official reference refer to MSDN/ TechNet. I have documented my personal experience on this blog.

Protected by Copyscape Web Plagiarism Finder

Site Meter