Monday, April 9, 2012

What is new in ASP.NET 3.5

ASP.NET AJAX
In ASP.NET 2.0, ASP.NET AJAX was used as an extension to it. You had to download the extensions and install it. However in ASP.NET 3.5, ASP.NET AJAX is integrated into the .NET Framework, thereby making the process of building cool user interfaces easier and intuitive.
The integration between webparts and the update panel is much smoother. Another noticeable feature is that you can now add ASP.NET AJAX Control Extenders to the toolbox in VS2008. Even though this is an IDE specific feature, however I feel it deserves a mention over here for developers, who had to add extenders using source view earlier. It is also worth noting that Windows Communication Foundation (WCF) now supports JSON along with other standard protocols like  SOAP, RSS and POX.
New Controls
The ListView and DataPager are new controls added along with a new datasource control called the LinqDataSource.
ListView
The ListView control is quiet flexible and contains features of the Gridview, Datagrid, Repeater and similar list controls available in ASP.NET 2.0. It provides the ability to insert, delete, page (using Data Pager), sort and edit data. However one feature of the ListView control that stands apart, is that it gives you a great amount of flexibility over the markup generated. So you have a complete control on how the data is to be displayed. You can now render your data without using the tag. You also get a rich set of templates with the ListView control.
DataPager
DataPager provides paging support to the ListView control. The best advantage is that you need not have to keep it ‘tied’ with the control on which the paging is being done. You can keep it anywhere on the page.
DataPager gives you a consistent way of paging with the controls that support it. Currently only ListView supports it as it implements the IPageableItemContainer. However support is likely to be added to other List controls as well.
LINQ
LINQ (Language Integrated Query) adds native data querying capability to C# and VB.NET along with the compiler and Intellisense support. LINQ is a component of .NET 3.5. LINQ defines operators that allow you to code your query in a consistent manner over databases, objects and XML.  The ASP.NET LinqDataSource control allows you to use LINQ to filter, order and group data before binding to the List controls.
ASP.NET Merge Tool
ASP.NET 3.5 includes a new merge tool (aspnet_merge.exe). This tool lets you combine and manage assemblies created by aspnet_compiler.exe. This tool was available earlier as an add-on.
New Assemblies
The new assemblies that would be of use to ASP.NET 3.5 developers are as follows:
·         System.Core.dll - Includes the implementation for LINQ to Objects
·         System.Data.Linq.dll - Includes the implementation for LINQ to SQL
·         System.Xml.Linq.dll - Includes the implementation for LINQ to XML
·         System.Data.DataSetExtensions.dll - Includes the implementation for LINQ to DataSet
·         System.Web.Extensions.dll: Includes the implementation for ASP.NET AJAX (new enhancements added) and new web controls as explained earlier.
Some Other Important Points
1.    ASP.NET 3.5 provides better support to IIS7. IIS7 and ASP.NET 3.5 modules and handlers support unified configuration.
2.    You can have multiple versions of ASP.NET on the same machine.
3.    For those who are wondering what happened to ASP.NET 3.0, well there isn’t anything called ASP.NET 3.0.
4.    VS 2002 worked with ASP.NET 1.0, VS 2003 worked with ASP.NET 1.1, and VS 2005 worked with ASP.NET 2.0. However VS 2008 supports multi-targeting, i.e it works with ASP.NET 2.0, and ASP.NET 3.5. 

Monday, March 26, 2012

C#'s const vs. readonly

A quick synopsis on the differences between 'const' and 'readonly' in C#:
'const':
Can't be static.
Value is evaluated at compile time.
Initiailized at declaration only.

'readonly':
Can be either instance-level or static.
Value is evaluated at run time.
Can be initialized in declaration or by code in the constructor.

Handlers vs. Modules

Modules are units of code that have registered for one or more pipeline events. They perform authentication, authorization, logging, etc. There is one task that is reserved for a special module, known as a handler. The handler’s unique job is to retrieve the resource that is requested in the URL. All resources served by IIS are mapped to a handler in configuration. If the configuration mapping does not exist, requests for the resource will receive a 404 HTTP status. In addition to the configuration mapping, which takes place before the pipeline begins, the handler mapping can be changed during request execution in the MAP_REQUEST_HANDLER event. This allows scenarios such as URL rewriting to work. Handlers are notified, or executed, in the EXECUTE_REQUEST_HANDLER step. (Note that only the mapped handler is notified, as you would expect.)

What is an application domain?

An application domain is the CLR equivalent of an operation system’s
process. An application domain is used to isolate applications from one
another. This is the same way an operating system process works. The
separation is required so that applications do not affect one another.
This separation is achieved by making sure than any given unique
virtual address space runs exactly one application and scopes the
resources for the process or application domain using that address space.

What are Object Initializers?

The Object initializers are the features for programming concepts which was introduced in C#.Net.

The aim of using Object Initializers is to initializing the accessible fields or properties
of an object without the need to write any parametrized constructor or separate
statements.

Sample:

using System;
class Student
{
int rollno;
string stdName;
static void Main()
{
Student s = new Student(){rollno=1,stdName="Ramesh" }; //Object Initializer
}
}

What is the purpose of IIS application pools?

We use application pools for isolation purpose. Every application within an application pool used the same worker process. Each worker process operates as a separate instance of the worker process executable, W3wp.exe, the worker process that services one application pool is separated from the worker process that services another.

In simplest words we use application pools for ISOLATION purpose.

Tuesday, March 20, 2012

Constructor in C#

  • A constructor is a special method whose task is to initialize the object of its class.
  • It is special because its name is the same as the class name.
  • They do not have return types, not even void and therefore they cannot return values.
  • They cannot be inherited, though a derived class can call the base class constructor.
  • Constructor is invoked whenever an object of its associated class is created.
  • Note: There is always atleast one constructor in every class. If you do not write a constructor, C# automatically provides one for you, this is called default constructor. Eg: class A, default constructor is A().

this Keyword in ASP.NET

this Keyword

Each object has a reference “this” which points to itself.

Two uses of this keyword.

o Can be used to refer to the current object.

o It can also be used by one constructor to explicitly invoke another constructor of the same class.

Thursday, February 23, 2012

Design Pattern Interview Questions

  1. Factory Design Pattern
  2. Abstract Factory Design Pattern
  3. Builder Design Pattern
  4. Prototype Design Pattern
  5. Singleton Design Pattern
  6. Adapter Design Pattern
  7. Bridge Design Pattern
  8. Composite Design Pattern
  9. Decorator Design Pattern
  10. Facade Design Pattern
  11. Flyweight Design Pattern
  12. Proxy Design Pattern
  13. Mediator Design Pattern
  14. Memento Design Pattern
  15. Interpreter Design Pattern
  16. Iterator Design Pattern
  17. COR Design Pattern
  18. Command Design Pattren
  19. State Design Pattern
  20. Strategy Design Pattern
  21. Observer Design Pattern
  22. Template Design Pattern
  23. Visitor Design Pattern
  24. Dependency IOC Design pattern

WCF, WPF, Silverlight, LINQ, Azure and EF 4.0 interview questions

  1. What is SOA, Services and Messages ?
  2. What is the difference between Service and Component?
  3. What are basic steps to create a WCF service ?
  4. What are endpoints, address, contracts and bindings?
  5. What are various ways of hosting WCF service?
  6. What is the difference of hosting a WCF service on IIS and Self hosting?
  7. What is the difference between BasicHttpBinding and WsHttpBinding?
  8. How can we do debugging and tracing in WCF?
  9. Can you explain transactions in WCF (theory)?
  10. How can we self host WCF service ?
  11. What are the different ways of implementing WCF Security?
  12. How can we implement SSL security on WCF(Transport Security)?
  13. How can we implement transport security plus message security in WCF ?
  14. How can we do WCF instancing ?
  15. How Can we do WCF Concurency and throttling?
  16. Can you explain the architecture of Silverlight ?
  17. What are the basic things needed to make a silverlight application ?
  18. How can we do transformations in SilverLight ?
  19. Can you explain animation fundamentals in SilverLight?
  20. What are the different layout methodologies in SilverLight?
  21. Can you explain one way , two way and one time bindings?
  22. How can we consume WCF service in SilverLight?
  23. How can we connect databases using SilverLight?
  24. What is LINQ and can you explain same with example?
  25. Can you explain a simple example of LINQ to SQL?
  26. How can we define relationships using LINQ to SQL?
  27. How can we optimize LINQ relationships queries using ‘DataLoadOptions’?
  28. Can we see a simple example of how we can do CRUD using LINQ to SQL?
  29. How can we call a stored procedure using LINQ?
  30. What is the need of WPF when we had GDI, GDI+ and DirectX?
  31. Can you explain how we can make a simple WPF application?
  32. Can you explain the three rendering modes i.e. Tier 0 , Tier 1 and Tier 2?
  33. Can you explain the Architecture of WPF?
  34. What is Azure?
  35. Can you explain Azure Costing?
  36. Can we see a simple Azure sample program?
  37. What are the different steps to create a simple Worker application?
  38. Can we understand Blobs in steps, Tables & Queues ?
  39. Can we see a simple example for Azure tables?
  40. What is Package and One click deploy(Deployment Part - 1) ?
  41. What is Web.config transformation (Deployment Part-2)?
  42. What is MEF and how can we implement the same?
  43. How is MEF different from DIIOC?
  44. Can you show us a simple implementation of MEF in Silverlight ?