Tuesday, January 20, 2009

Whats new in C# 4.0?


Whats new in C# 4.0?
Every new version of C# has a major improvement theme. 1.0 was about managed code; 2.0 was about generics; 3.0 introduced Functional Programming and LINQ.
And now 4.0 introduces dynamic programming.
A new keyword called dynamic which can be used to define a variable, function reurn type or a parameter, which the compiler will not bother to resolve calls during compilation, instead it will delay all method resolution to run time.

This technology dynamic lookup. The basis of the dynamic resolution is the IDynamicObject interface, shared with the Dynamic Language Runtime. This has on it methods like Invoke which the compiler will call to allow the object itself to participate in method resolution.


There are three primary scenarios that will be enabled by the new support for dynamic lookup:

Office automation and other COM Interop scenarios

Consuming types written in dynamic languages

Enhanced support for reflection .

No comments:

Post a Comment

Please leave your comments