Microsoft .NET Framework introduces a platform that opens a lot of possibilities. It provides a managed platform for executing applications that are portable, scalable, and robust. Microsoft .NET Framework 4 ships with Visual Studio 2010. The notable of features provided by .NET Framework includes: support for cross-language integration, the Common Type System, the Base Class Library, Common Language Runtime (CLR), the just-in-time (JIT) compiler, and automated garbage collection. This article takes a look at the new features of Microsoft .NET Framework 4.
New Features in Microsoft .NET Framework 4
A lot of new features and enhancements have been introduced in .NET Framework 4. The most important of them include the following:
- The Dynamic Language Runtime
- Managed Extensibility Framework
- Support for Parallel Computing
- ADO.NET Improvements
- WCF Improvements
- WWF Improvements
The Dynamic Language Runtime (DLR)
The Dynamic Language Runtime (DLR) is built on top of the Common Language Runtime (CLR) and opens the door for a common set of technologies and tools to interoperate inside a common framework. The Dynamic Language Runtime environment enables the developers to implement applications using dynamic languages like Python and Ruby on top of the .NET Framework runtime. It is a runtime environment built on top of the managed environment of the CLR that provides support for implementing dynamic features in statically typed languages, sharing of libraries and objects and fast dynamic dispatch and invocation.
The Wikipedia states: "The Dynamic Language Runtime (DLR) from Microsoft is an ongoing effort to bring a set of services that run on top of the Common Language Runtime (CLR) and provides language services for several different dynamic languages." Reference: http://en.wikipedia.org/wiki/Dynamic_Language_Runtime
The DLR adds a set of services that facilitate dynamic language implementations on .NET's managed platform. These services include support for a dynamic type system, a standard hosting model, and fast dynamic code generation. In addition, the DLR lets dynamic and static languages interoperate bi-directionally.
The new System.Dynamic namespace in Microsoft .NET Framework 4.0 provides support for the Dynamic Language Runtime environment. The MSDN states: "The dynamic language runtime (DLR) is a runtime environment that adds a set of services for dynamic languages to the common language runtime (CLR). The DLR makes it easier to develop dynamic languages to run on the .NET Framework and to add dynamic features to statically typed languages." Reference: http://msdn.microsoft.com/en-us/library/dd233052.aspx
The Dynamic Language Runtime is comprised of the following three layers:
1. The .NET Language Integration Layer
2. The Dynamic Language Runtime Code Components
3. Language Binders
The Dynamic Language Runtime environment provides the following services:
- Dynamic Method Dispatch
- Dynamic Code Generation
- Hosting API
Managed Extensibility Framework
The Managed Extensibility Framework is a new framework that can be used to implement lightweight, extensible and composable applications that can leverage the features and benefits of the CLR. You can use the Managed Extensibility Framework (MEF) to enable extensions to be reused within the same application or across applications. You can know more on the Managed Extensibility Framework from this MSDN article: http://msdn.microsoft.com/en-us/library/dd460648.aspx
Support for Parallel Computing
Microsoft .NET Framework 4 provides support for a parallel computing model - you can now write multithreaded applications and asynchronous code with much power and simplicity. You now have the Parallel Extensions library (previously known as Parallel Framework Extensions PFX, a managed concurrency library for designing and implementing applications that can take advantage of parallel hardware in your system. The Parallel Extensions library comprises of a task parallelism component called Task Parallel Library and Parallel LINQ. Parallel LINQ is a concurrency execution engine that is used to execute LINQ queries on multicore processors.
With .NET Framework 4, you have support for implementing model first development and persistent ignorant objects. These are also known as Plain Old CLR Objects (POCO) objects. These POCO entities or persistent ignorant objects enable you to design classes removes the need of having persistence specific concerns in your entity classes. You now also have support for using functions in your LINQ queries. You can know more on ADO.NET improvements in .NET 4 from this link: http://msdn.microsoft.com/en-us/library/ex6y04yf.aspx
Improvements in Windows Communication Foundation
Windows Communication Foundation (WCF) is a platform that can be used to design and implement platform independent, scalable services. It is a framework that provides a platform for unification of a number of enterprise technologies under one roof. Windows Communication Foundation (WCF) was first introduced as part of .NET Framework 3.0.
The improvements in WCF in .NET Framework 4 are:
- Support for Simplified configuration
- Support for Standard endpoints
- Support for Simplified IIS Hosting
- Support for enhanced REST features
- Support for Workflow services
- Support for Routing service
Improvements in Windows Workflow Foundation
Windows Workflow Foundation provides you a simplified framework for design and development of workflow based applications using .NET Framework. Windows Workflow Foundation was also first introduced as part of Microsoft .NET Framework 3.0. The improvements in Windows Workflow Foundation in .NET Framework 4 include the following:
- Improved extensibility in the WF Designer
- Better hosting, persistence and tracking features
- Improved workflow activity model
- Improved built-in activity library
Microsoft .NET Framework 4 has introduced a lot of improvements in Windows Communication Foundation and Windows Workflow Foundation. Besides, the new Dynamic Language Runtime and Managed Extensibility Framework have been introduced. You also have improved support for Parallel Computing now. In this article we discussed the most important and widely used of the new features in Microsoft .NET Framework 4. Happy reading!