Monday, July 2, 2012

Event and Delegate


What is an Event?


When an action is performed, this action is noticed by the computer application based on which the output is displayed. These actions are called events. Examples of events are pressing of the keys on the keyboard, clicking of the mouse. Likewise, there are a number of events which capture your actions.


Delegate :


Delegates are kind of similar to the function pointers. But they are secure and type-safe. A delegate instance encapsulates a static or an instance method. Declaring a delegate defines a reference type which can be used to encapsulate a method having a specific signature.


Language Integrated Query ( LINQ )


What is Language Integrated Query (LINQ)? 


LINQ is a set of extensions to .NET Framework that encapsulate language integrated query, set and other transformation operations. It extends VB, C# with their language syntax for queries. It also provides class libraries which allow a developer to take advantages of these features.

.NET Mobile overview

.NET Mobile overview


.NET Mobile is a platform for developing applications for mobile phones. It’s an extension to .NET Framework and is called Microsoft Mobile Internet Toolkit. It is a set of server side forms controls. These controls produce different output formats i.e. WML, HTML or even compact HTML. This allows developers to create an application using a single paradigm instead of developing an application multiple times using different paradigms based on what different mobiles support. The advantage is standardization, less redundancy, and Microsoft support.

Handle Exceptions in .NET 2.0


Explain how to Handle Exceptions in .NET 2.0.


There are different methods for handling the exceptions. For example


Method 1 :


try
{
     // code here
}
catch(Exceptiontype *etype_object)
{
     // code here.
}


Method 2 :
try
{
       // code
}
catch(Exceptiontype *etype_object)
{
        throw new Custom_Exception();
}

Difference between object pooling and connection pooling


How does object pooling and connection pooling differ?


In Object pooling, you can control the number of connections. In connection pooling, you can control the maximum number reached.


When using connection pooling, if there is nothing in the pool, a connection is created since the creation is on the same thread.


In object pooling, the pool decides the creation of an object depending on whether the maximum is reached which in case if it is, the next available object is returned. However, this could increase the time complexity if the object is heavy.