Scott Golightly
Advaiya, Inc.
Published: May, 2009
One of the things that I enjoy about my job is the chance
that I get to talk to different people about their development platform and the
things that make creating and using software easier for them. After the
Microsoft Professional Developer’s Conference (PDC) in October 2008, I have had
the chance to talk about the different parts of the upcoming release of the
.NET Framework. I have included a high level overview of the features that come
up most often in conversation where people have told me they expect to be able
to save time and effort with the changes in .NET Framework 4. Recently
Microsoft has focused on 3 benefits of the framework in three categories: Deep
Investments in the Core Framework, Superior Developer Productivity, and Extend
the .NET Continuum. I will also group the features into these three areas.
For more details and examples of each of these features
please see the documentation included with the beta 1 download.
Deep Investments in the Core Framework
In 2002 Microsoft released the .NET Framework 1.0 with the
idea that common functionality should be included in the base class library
(BCL) to allow developers to focus on solving business problems and not creating
the infrastructure code needed to solve them. This release adds new classes to
the BCL to continue solving common problems. Since 2002 there have also been
many changes in the standard computer and the expectations of developers and
end users. Computers today come with more memory, larger hard drives, and
better graphics cards than the typical computer had in 2002. In addition to
computers getting faster processors, most new computers today have a 64 bit
processor with multiple cores in a single CPU. The .NET Framework has continued
to evolve to take advantage of the changes in hardware.
.NET Framework 4 includes the Task Parallel Library (TPL)
and Parallel Language Integrated Query (PLINQ) to enable developers to easily
write applications that can execute in parallel across the multiple processors
and cores in modern computers. The classes included in the framework relieve
the developer from having to learn about and consider concurrency controls like
lock, semaphore, and mutex to avoid common problems with parallel processing. Additional
features have been added to Visual Studio to make debugging parallel
applications easier.
Microsoft has also added the Managed Extensibility Framework
(MEF) that will allow applications to be dynamically composed. The
extensibility provided by MEF allows easier creation of add-ins and extensions.
Applications can use the framework to dynamically add in new functionality at
runtime. Much like the ability to download and install plug-ins in a browser to
support additional functionality, applications can be customized and evolve
even after the initial release.
As the .NET Framework has evolved since its initial release
most of the changes have been additive allowing programs created using older
versions of the framework to run on the newer version of the framework.
Microsoft has been very good at documenting changes to the framework and
providing descriptive error messages when a breaking change occurs. With .NET 4
Microsoft has added the ability to have both version 3.5 SP1 and 4 loaded into
the same process. Applications loading
add-ins or using MEF to provide extensibility points can now load add-ins that
rely on version 2.0, 3.0, 3.5, or 4 of the framework.
In version 3.5 of the framework Microsoft started integrating
workflow into Windows Communication Foundation (WCF). In this version the
integration becomes deeper. In the .NET framework 4, services can be declared
in the same eXtensible Application Markup Language (XAML) language that Windows
Workflow Foundation (WF) uses. This will allow developers to reuse their skills
and create simple workflow services in a single language.
One of the key features of the .NET Framework from the
beginning has been the ability to support multiple languages. This allows users
to be productive in whichever language they feel most comfortable with. In the
.NET Framework 4 the C# and VB.NET languages each get improvements to support
features that have been available in the framework itself but not supported in
the language. The new features in C# include optional parameters and named
parameters so library writers can write fewer overloaded methods and to ease
COM interoperability from C#. VB.NET is improved to remove the need for
underscore characters as a line continuation character, auto implemented
properties, and multi-line lambda expressions. Overall the changes will make
the choice of language more a personal preference than a comparison of language
features.
The other new language feature that seems to have a large
mind share among developers is the support in the framework for the Dynamic
Language Runtime (DLR). The DLR provides a foundation for dynamic languages to
compile to the same intermediate language as other .NET languages. Along with
the DLR Microsoft is releasing three dynamic languages F#, IronRuby, and
IronPython.
Superior Developer Productivity
ASP.NET is the technology for creating web pages and
applications on the .NET development platform. Web applications have seen a lot
of innovation and continue to be used by organizations to provide applications
quickly with a low deployment cost. In addition web applications are becoming
more interactive with rich media, social interaction, and fast response from
the web server becoming the expected norm. Microsoft has continued to innovate
in web applications and has produced several out of band releases to help
developers create ASP.NET applications using new application styles like AJAX
and MVC that have been included in the core ASP.NET product in Beta 1.
Microsoft is including improvements to the AJAX framework in
beta 1. There are new controls and a set of ASP.NET AJAX client templates included
in the Beta 1 release. The AJAX control toolkit is enhanced with new controls
that have been available in on CodePlex but are now included in the core
product. On the client side there are also new controls, improved DOM
selection, and animation features. These improvements will make creating
interactive web pages easier.
The ASP.NET MVC framework, a framework for creating web
applications that use a model-view-controller pattern, is also included in the
beta 1 release. The MVC framework allows complete control over the generated
HTML. The MVC framework also separates the handling of request from the
creation of HTML. This separation of concerns allows for easier automated
testing of web sites to ensure that web sites are functionally correct. Also of
note is the open source jQuery JavaScript library which has been included with
ASP.NET to provide additional JavaScript support. Having a supported JavaScript
library included with the framework reduces the need for developers to write
and debug their own JavaScript libraries.
The ASP.NET Dynamic Data allows developers to create data
driven web applications with a minimal amount of code. The Dynamic Data
framework allow developers to create web pages based off of a LINQ query or
ADO.NET Data Services model and provides basic UI to manipulate the data. Pages
created with ASP.NET Dynamic Data can be integrated into existing ASP.NET web
sites.
WCF is also being enhanced in its support for
Representational State Transfer (REST) based services. Some of the work done
with the REST starter kit for WCF on CodePlex is being included with this
release to allow developers to create services that will take advantage of the
simple interface and cacheability of REST services. With built in support for
JSON, ATOM, and POX from RESTful services, organizations have more options on
how to interoperate between different applications, services, and platforms.
Extend the .NET Continuum
Windows Communication Foundation (WCF) provides a very
powerful unified communications infrastructure for developers to be able to
write applications that can communicate over different transports and
protocols. .NET 4 adds additional functionality to make that task easier for
developers. There are additional standard bindings that support the common use
cases. In addition WCF now supports default bindings so a service that does not
specify a binding will automatically use the default binding specified at the
application or machine level.
Windows Workflow Foundation (WF) introduces a new
programming model in .NET 4 that is declarative (XAML-based) by default, easier
to host, performance has been increased through an enhanced persistence store
and use of ETW for tracing, and a more explicit activity object model that
makes it easier to create activities. Additionally, the new WPF-based designer
for creating and debugging workflows will help developers and end users better
communicate about a workflow’s requirements to solve business problems.
Another change with WF that has garnered the attention of
the WF experts that I know is the change away from using the state machine
workflows to a FlowChart style workflow. The majority of existing state machine
workflows can be migrated to the FlowChart workflow and the pick activity. The
FlowChart workflow also provides familiar idioms for creating workflows.
All of the changes in WCF and WF allow developers to create
services that will easily scale up to handle high transaction workloads,
provides better logging and tracing of processes, and reduce the amount of time
spent writing “plumbing code”. Having a streamlined set of skills needed to
accomplish these tasks will allow a wider range of developers to work with
middle tier applications.
The middle tier is not the only place where Microsoft is
ensuring that developers can reuse their existing skills to create new and
exciting applications. Windows Presentation Foundation (WPF) is also getting
new features to support advances in hardware and current use cases.
As more line of business applications use WPF, Microsoft has
included improvements to help more easily create those LOB applications. The
major improvements include a data grid control to improve the experience when
building data centric applications. There are also advances in text layout and
localization support for applications that need to display data in multiple
languages.
.NET 4 has support for multi-touch devices. New touch
screens and the Microsoft Surface have started developers thinking about how
people can collaborate and use tactile interaction with the computer. By making
it easier for developers to add support for these new features to their
applications, new and innovative applications will begin to appear in the
marketplace.
Microsoft has long produced tools to help developers to use
their languages and frameworks effectively. With the release of .NET 4 a new
version of Visual Studio named Visual Studio 2010 will also be released. Visual
Studio 2010 will be written in WPF and support all of the framework and
language features discussed in this article. Microsoft is also using MEF in
developing Visual Studio 2010 to provide easier integration with add-ins. This
should allow other developers to provide functionality that Microsoft has not
added in the core product. By opening up the add-in market to a larger number
of developers we should see better integration with popular open source and
commercial development tools.
Visual Studio 2010 will also include additional project
templates. Beyond the ones already discussed is the inclusion of development
templates for SharePoint. Many organizations have standardized on SharePoint as
their collaboration environment. While SharePoint provides a lot of
functionality, unique business requirements sometimes require customization to
the server.
Conclusion
This paper has barely scratched the surface of all the new
features in beta 1 of the .NET Framework 4. There are many more features and
improvements than can be mentioned in a single article. For more detailed
information on these features or to find out about other features in beta 1,
please see the product documentation and the discussion forums.
About the Author
Scott Golightly is an Enterprise Solution Strategist with
Advaiya, Inc. (http://www.advaiya.com) where he helps his clients to make wise
use of their software platform. Scott is also a Regional Director
(http://www.theregion.com) and enjoys learning about and teaching others about Microsoft
development tools. When Scott is not working at his computer he enjoys spending
time with his family and being in the outdoors. If you have questions about
this article please contact Scott at Scott.Golightly@advaiya.com.