Abstract
Microsoft endeavors to address the evolving challenges in Enterprise Application
Development through the release of .NET framework 4 and Visual Studio 2010
(VS2010).
Microsoft .NET 4 comes with host of new features that makes enterprise application
development more productive and manageable. The new efficient Common
Language Runtime (CLR), multi core programming, functional and dynamic
language programming support, ability to easily expose business logic and workflow
as services; enhancements in REST and Object relational mapping framework, are
some of the features that bring additional value to the platform.
Visual Studio 2010 through new Windows Presentation Foundation (WPF) based
User Interface brings support for architecture modeling, parallel program debugging,
Lab management and is a unified IDE for all Microsoft technologies through
support for Windows Azure (Cloud) and SharePoint 2010 application development
templates.
Infosys Microsoft Technology Center has evaluated .NET 4 and VS2010. This paper
presents Infosys perspective on the enhancements in .NET Framework 4 and Visual
Studio 2010.
Jul 2010
Introduction
Innovation and, nonlinear growth are the key challenges of modern day enterprises. With mergers and acquisitions on the
rise enterprises are growing larger and more complex. The business application development paradigm has changed from
built to last to built to change with increasing complexity, increase in user base, ever increasing need for compliance
and interoperability. The applications of today, need to be socially aware, connected, inter operable, responsive and scalable
within the ecosystem and serve the diverse set of users without causing disruption in experience, or behavior.
It is observed that the bespoke application development is converging to more stable platforms like Java Enterprise
Edition (JEE) or Microsoft .NET [1]. In several enterprises both the platforms are adopted based on the needs of specific
organizations and strength of each platform [1]. Till a few years back, JEE platform was used to build scalable server side of
application or services where as Microsoft .NET was used for building rich presentation layers using ASP.NET, etc. However
such architectural arrangement in multiple platforms significantly increases total cost of ownership for enterprises. Microsoft
.NET through frequent releases with new features and improved functionality is trying to address the un-served part of the
enterprise needs.
Following figure 1.0 is a snapshot of .NET framework releases since its inception. Microsoft .NET first saw the light in year
2000 and RTM (release to manufacture) in 2002. Since then it has evolved rapidly and gaining adoption in enterprises [1].
During its evolution it has brought in features to address complex problems in enterprise bespoke application development.
NOTE
Each Base class library version depicted above corresponds to respective .NET framework
version. The CLR version has remained 2.0 for .NET framework 2.0, 3.0, 3.5 and 3.5 SP1
where as in other cases CLR version has kept pace with overall .NET Framework version.
.NET 4 comes with completely new CLR (CLR 4.0)
To embrace any new product or framework is a challenge and to do so enterprises are required to have a strong business
case. The new framework adoption faces stiff resistance as it brings along challenges of compatibility, stability, migration, or
engineering / re-engineering techniques.
Choice of techniques have bearing on various attributes (functional and non-functional) needed in the new application,
feature set or pain points the new framework claims to solve, existing skill set within the enterprise and marketplace, vendor,
framework stability, and successful case studies.
It could also be due to any of operational, tactical and strategic reasons like need to get rid of unsupported platforms,
enterprise licensing policy, adoption of architectural patterns or trends like Service Oriented Architecture (SOA), Web 2.0,
Cloud, etc.
This view point highlights some key drivers for .NET 4 and VS2010 adoption within an enterprise and is intended for
Technology Decision Makers, Architects, Senior Developers who have broad understanding of Microsoft .NET platform..
Faster and efficient processing of complex algorithms and large data sets
Hardware manufacturers are no longer able to increase the speed of individual CPU instead they are increasing the cores
to provide high speed. Due to this trend, multi core processors are becoming the order of the day. There is hardly an
enterprise where applications are not running on multi core servers, but still there is no direct correlation of improvement
in performance (throughput or response time) with the number of cores the application is running. Exploiting the power
of such multi core machines, writing complex threaded programs to enable parallel activities and avoid dead locks is a
challenging task for developer.
NOTE
For domain centric applications in Banking, Insurance, Pharmaceuticals, Retail, Manufacturing, etc. mapping domain
concepts/models to relational concepts/entities in data access layer needs significant amount of custom mapping and
translation code.
Traceability
Ensuring traceability during application development life cycle is one of the biggest challenges. If traceability is not ensured
appropriately, over a period, incorporating change requests in application becomes impossible and maintenance a nightmare.
Addressing Challenges
Microsoft .NET Framework 4 and VS2010 helps address most of the challenges listed above. Before we start addressing above
mentioned challenges, here is a brief overview of .NET framework 4 and Visual Studio 2010.
User Interfaces: .NET framework provides infrastructure library to build user Interface or presentation logic for client
applications in the form of:
Windows Forms: Used to build standard windows based thick/smart client applications using Rapid Application
Development (RAD).
Windows Presentation Foundation (WPF): Provides rich media (audio, video, animations, touch, and gestures)
capabilities to a thick/smart client application running on Windows.
ASP.NET is used to build rich browser based internet applications.
Silverlight is a cross platform, cross browser small plug-in which runs in client browser and used to provide rich
media experience over internet.
Services: .NET framework provides a way to decouple and develop various logic into tiers and expose them as service using
SOA paradigm.
Windows Communication Foundation (WCF): to build interoperable services based on WS-* standards.
Windows Workflow Foundation (WF): to build process oriented business workflow and rule engines.
WCF Data services (earlier ADO.NET Data services or Astoria): help in exposing relational or non-relational entities as
services (including REST based).
Data Access: .NET framework provides assemblies for querying and manipulating data access logic in data tier.
ADO.NET libraries provide a way to create a Data Access Layer (DAL) to query and manipulate data in underlying
database through inline SQL statements or stored procedures.
LINQ to SQL provides a way to interact with Microsoft SQL Server database using C# or VB.NET, independent of a
specific database query language.
Entity Framework provides object relational mapping capabilities to query any database that has ADO.NET provider
e.g. SQL Server, Oracle, Sybase, etc.
Application Modularization
With .NET Framework 4, Managed Extensibility Framework (MEF) provides on the fly extensibility to .NET applications and
truly brings in plug and play component/modules realization.
Functional Programming
F# [13] is a .NET programming language combining functional programming [12] and object oriented programming. F#
works alongside .NET languages like C# or VB.NET, which means part of the application logic, can be realized using C#
or VB.NET programming language. It is new addition in VS2010 and can be used to develop applications from .NET 2.0
onwards.
NOTE
Functional programs are easy to unit test and debug as each function works on inputs it
receives and dont modify any data outside the scope of functions. Due to this, they are
always ready candidates for execution in parallel (concurrency) benefiting most from multi
core processor architectures and giving best performance.
They help in program optimization by adhering to the principle of Lazy evaluation, means
deferring
execution till really needed unlike serial execution in C#, VB.NET, or Java programs.
Although data is not passed across functions but same can be achieved by passing
functions as parameter to functions and the phenomenon is called higher order functions.
Aggregated results can be delivered by wrapping functions around another function referred
as currying. Some complex navigation/brokering logic usually achieved in C#, etc. through
switch cases or if else statements can be simplified through pattern matching in functional
languages.
Leveraging some of the above highlighted principles, functional programming lets one build
highly complex algorithms rapidly in very simple, and error free manner.
Microsoft through Windows Server AppFabric [5] is providing middle tier server class functionality for hosting,
instancing, transaction management, messaging, persistence, scaling, monitoring, and management of business logic
as services or workflows.
NOTE
At this point, AppFabric is a separate download and installs over Windows Internet
Information Server (IIS) 7. AppFabric provides a dashboard view into business workflow
and services. One can dynamically increase/decrease the no. of executing services and
workflow instances, start or stop instances, trace and track to debug and report the message
flow in the system. This will be very useful in auto scaling and monitoring the SLAs agreed
for the system.
Dynamic Language Runtime (DLR) is a new runtime environment providing set of services for dynamic languages to
CLR. DLR makes it easier to develop dynamic languages to run on .NET framework and to add dynamic features to
statistically typed languages.
Dynamic Languages are a class of high level programming languages that executes at
runtime many common behaviors such as
type validation (declaring variables or operations without any particular type)
method dispatch (late binding or polymorphism)
type creation (creating new types on the fly)
parsing (runtime evaluation of source code)
NOTE
Microsoft Visual Studio 2010 [4] is an IDE (Integrated Development Environment) for developing, debugging, testing
applications for web, mobile, smart, and thick client using .NET CLR and DLR (Dynamic Language Runtime) managed
languages. It also provides complete end to end application life cycle (ALM) management support from requirements to
architecture to build and test management.
Addressing Challenges
.NET framework 4 introduces parallel library to help write programs that can automatically distribute work to
multiple cores depending on their availability. While using parallel library logic that needs to be run in parallel has
to be explicitly marked through Parallel.For or similar constructs. Depending on the logic that needs to be run in
parallel, we have observed the performance improvement achieved using parallel library can sometimes be in direct
proportion to the number of cores.
Importantly, programs written or targeted for multi-cores can also run on single core machines without any syntax or
configuration changes (subject to performance difference). However programs that are not written using parallel API
needs to be changed/adapted to use parallel API if it is to get performance benefit from multi core architecture, though
the change in program is a very small.
Enterprises will find effective usage of multi core machines for application logic developed using .NET Framework 4
parallel APIs and see significant improvement in application performance. VS2010 also provides extensive support
for debugging and profiling .NET parallel programs which comes very handy for developers writing and testing such
programs.
With .NET Framework 4, Managed Extensibility Framework (MEF) provides on the fly extensibility to .NET
applications and truly brings in plug and play component/modules realization. The MEF based new component
assembly needs to be placed in container (OS folder) and the application will automatically pick up the new assembly
based on the Import and Export attributes set in the program. This happens without recompiling of the application or
any configuration changes and is really simple to use unlike patterns like Unity Application Block [2] for dependency
injection. MEF has extensibility potential to the tune of changing flight engine in the air and is a perfect solution for
enterprise application software scenario described in the above challenges section.
Languages like C# or VB.NET at times may not be best suitable to solve computational problems in Operations
Research, Artificial Intelligence, Bio Informatics, Energy trading or other domains. At the same time old generation
languages like FORTRAN, C etc., dont match up in relevance with the current programming paradigms. F# is aimed
at solving complex mathematical algorithm, simulation, parallel programming problems in Operations Research,
Artificial Intelligence, Bio Informatics, Energy trading, etc.
Generating web pages at runtime, tools/utility scripts, validation logic, web, test harnesses are best candidate for
Dynamic Languages [11] like Python, Ruby which was a void in Microsoft platform till .NET Framework 4
Traditionally Microsoft application developers had been dealing with these through combination of VB script, ActiveX,
C#, ASP.NET which made it complex to handle such scenarios. Third party dynamic languages like Perl for .NET or
Python for .NET have no deep integration with CLR and did not produce managed code (IL).
IronPython [15], and IronRuby [16] are open source implementation of Python and Ruby programming languages
respectively, targeting Microsoft .NET and Silverlight to address the above mentioned scenarios. With Silverlight it can
be used as one of the language to program scenarios in multi-media graphics, animations, gaming etc. DLR provides
a common framework and runtime to implement dynamic languages on top of it. Because DLR is built over CLR, the
dynamic languages can easily interoperate with CLR languages like C# or VB.NET and enterprise can benefit from
their respective unique characteristics.
Until .NET framework 4, for building REST based applications there was no out of the box framework support, but
was possible primarily through WCF REST Starter kit.
Starting .NET 4, Out of box support to expose business logic as REST services without any custom implementation
is possible through WCF 4.0 REST support. Additionally WCF 4.0 Data services (earlier Astoria or ADO.NET Data
services) provide a way to expose relational and non-relational database entities and data as REST services providing
drill down access through user friendly URIs. This will help to open up business logic as REST services without much
effort and time in custom implementation. REST based business services means more diverse users can access and
benefit from usage of it.
Exposing business workflow as services is made possible through Windows workflow 4.0. Business workflows can be
exposed as services without building any additional service wrappers or specialized endpoints. This feature can help
in seamlessly connecting partner, customer applications with enterprise applications.
E.g. Order management workflow system connecting seamlessly with suppliers/vendors system through workflow
services would significantly help improve service SLAs.
XAML based design of workflow brings in benefit of simplified design and hosting. There are significant performance
improvements with WF 4.0 as it is written from scratch. E.g. WF 4.0 provides performance improvement from
serialization of only current set of execution activities as against the complete activity tree in WF 3.5 [10].WF 4.0 also
has very efficient programming model for developer to work with.
AppFabric helps in hosting of large scale complex service oriented applications. Henceforth, enterprises will have
.NET business services and workflow management server capabilities available Out of box through AppFabric.
To cater better performance, scalability, availability for elastic distributed architecture scenarios, AppFabric also
provides functionality for in-memory distributed caching to cache reference data such as catalogs, profiles and
session data such as shopping cart. Earlier .NET architectures have to rely on third party components like memcache,
NCache to realize such functionality. Out of box support for distributed caching will help achieve high scalability and
availability through AppFabric at no extra cost. We believe this is much needed and most awaited functionality in the
platform and will help to run server class highly scalable applications on .NET platform.
To map complex business domain model to structures in relational databases a very common programming pattern
is used called as object relational mapping. To implement object relational mapping, earlier Microsoft .NET based
bespoke applications needed significant amount of custom implementation or third party frameworks like NHibernate
or iBatis. Entity Framework provides a way to map relational entities to domain entities. It helps in building
information or domain model independent of database technologies and is very useful in data access layer modeling in
domain centric applications.
In addition to Entity Framework, to further help generating CRUD (Create-Retrieve-Update-Delete) operations on top
of the Entity Model, VS 2010 supports development of WCF RIA Services (earlier ADO.NET RIA Services). WCF RIA
Services provides a platform to expose Entity Model as CRUD methods generated automatically as a uniform middle
tier for building ASP.NET / Silverlight / WPF / Winform clients. WCF RIA Services is available as a part of Silverlight
Tools for Visual Studio 2010 and provides templates and Data Source controls for Visual Studio 2010
10 | Infosys View Point
Prior to .NET Framework 4, if .NET 3.5 (CLR 2.0) and .NET 1.1 (CLR 1.1) based component or office add-in is part
of one application, both the components used to run using single highest version of CLR that is launched for the
application. In this case the application will run with CLR 2.0 (.NET 3.5). Since .NET 1.1 based components needed
CLR 1.1 to run but are forced to run with CLR 2.0 as it hosted alongside .NET 3.5 (CLR 2.0) applications, at times
which used to create conflicts leading to application instability.
However starting .NET Framework 4, .NET 4 components can be hosted alongside legacy .NET 2.0, 3.0, 3.5
components without causing issues to each other. This is possible because .NET Framework 4 based components
launch CLR 4.0 for its execution whereas legacy .NET components launch the respective CLR version and both the
CLR versions run within the same host without breaking the execution of one another. This is referred as in-process
side by side execution. We feel this is an important feature for mix bag of .NET applications running in enterprises
and will save considerable testing and rollout effort on multiple version compatibility for Enterprise IT.
The application performance with .NET Framework 4 has significantly increased because of the improvements in
garbage collector, better threading algorithm and thread pool optimizations. In earlier versions of .NET especially with
desktop applications, when GC (garbage collector) used to run for memory reclamation of large objects, it stopped
the execution of main thread at times. This used to have impact on responsiveness of UI. With .NET Framework 4,
the full GC, runs in the background, collecting large objects as well without stopping the main thread of execution
thus reducing the latency. We feel this is a very significant improvement in core framework for enterprise desktop
applications running on .NET Framework 4. However for server applications (server GC) this feature doesnt exist but
expected in next release.
VS2010 provides built in support for Architecture modeling using UML 2.1.2 diagram types like Use case, Sequence,
Class, Component, etc. It provides architecture layer dependency/coupling validation of .NET programs through
layer diagrams. This feature is extremely useful for code compliance with architecture at any stage during life cycle.
It also provides a way to explore code through architecture explorer and Directed Graph Markup Language (DGML)
diagrams. Architecture and code can be maintained in synchronization using forward and reverse engineering
techniques. With VS2010 enterprises dont need to invest in independent architecture modeling tool for modeling
Microsoft .NET projects.
VS2010 lab management [14] helps to quickly create, destroy virtual test environment where application test can
be recorded by test analyst. Recorded tests can be reproduced for developer to view and fix the issue. The lab
management helps in creating the virtualized images of development, test environment which can be copied and
reproduced at different locations with ease. This helps in setting up various dev., test environments faster. Testing and
bug reproduction used to take huge amount of effort across development and testing teams which will be reduced
significantly through this feature.
VS2010 through the support of hierarchical work items provides a means to ensure traceability in the application.
Requirements can be recorded as work items and can be associated with any of the artifacts like UML use cases,
architecture models, C# code files. Once association is established, any changes made in the artifacts can be explored
by querying the associated work item and obtaining all linked/associated objects. Thus employment of improved
traceability techniques will help in ease of change management and maintenance.
SharePoint 2010 and Windows Azure Cloud application development is possible through out of box templates in
VS2010. Windows Phone 7 and Silverlight 4.0 development is possible by installing freely available add-ons in
VS2010. All this together through Visual studio will provide developer a unified consistent interface for application
development. This in turn helps in improving the productivity for developing respective application stereotypes.
Adoption Approach
We recommend that enterprises should keep a close watch on the extended support dates of .NET 1.0, 1.1 and Visual Studio
2003. This will help in preparing an upgrade strategy with minimum one to two years in advance of main stream support
ending dates.
.NET Framework 4 and VS2010 can be adopted in Enterprise either through upgrading/migrating existing .NET applications
or re-engineering existing applications or for building completely new applications. The enterprise can evaluate the
application portfolio for the feasibility of suitable approach. On evaluation, the application engineering, re-engineering or
upgrade should ideally be done in phased manner, avoiding a complete overall revamp at a go, unless absolutely justified
by a business need. .NET Framework 4 is in its early stages of adoption and there could be potential risks from big bang
approach especially if it is a large application portfolio (more than 50 applications). However consideration of Software
Factory [8] based approach can help in faster and design pattern based best practices implementation which can help in long
term application maintainability.
Application Upgrade
For any enterprise application, Application upgrade from .NET 1.0, .NET 1.1 to .NET 4 would require considerable
reengineering effort, given that a lot of new features and improvements have happened over successive versions. Application
Upgrade from .NET 2.0, .NET 3.0 or .NET 3.5 to .NET 4 would require less effort and in many case simple upgrades
by opening the legacy .NET project in VS2010 may be good enough. The .NET APIs which are supported for backward
compatibility will continue to work, but to really exploit the benefit of .NET 4 for the application; developers may have to
explicitly make use of specific APIs in certain cases. It is recommended that where possible older workflows to be migrated
to WF 4.0, workflow migration guide [17] can be useful in this effort. If services are built using WCF 3.5 SP1 then it can
be moved to work in .NET Framework 4 without much rewrite. The features available in WCF REST starter kit with .NET
3.5 have been integrated into .NET 4 and would mostly function well with minimal amount of changes. Similarly Entity
Framework or WCF Data Services can be easily moved to work in .NET 4 and also can benefit from new features available.
Workflow modeling
The VS 2010 workflow modeler for WF 4 is developer focused and is not business analyst friendly. To use the workflow
modeler one has to be aware of various .NET 4 modeling activities and how to use them to realize a specific business
workflow scenario.
Additionally during requirements modeling phase, VS2010 UML (Unified Modeling Language) activity diagrams developed
cannot be reused as WF 4 models.
Summary
.NET 4 and Visual Studio 2010 is a major release from its predecessor and bring in several improvements that
enterprises can benefit from. The new framework can be used to build an array of application development scenarios
like:
Build easily extensible composite applications (consisting of multiple modules) in plug and play manner
without recompiling the application using MEF
Build seamless partner integration, end to end order management scenario spanning multiple departments
using newly introduced workflow services
Build highly interoperable and scalable applications like Twitter, Facebook, Amazon by exposing business
functionality as WCF REST services
Expose database entities as drill down REST services through WCF Data Services
Model easier, faster business domain models in pharmaceuticals, insurance, energy, etc. domains through
Entity frameworks object relational mapping capabilities
Cache less volatile information like product catalogs, shopping basket, user profiles in middle tier using
distributed caching framework of AppFabric to achieve high availability and scale
Build Web 2.0 kind of support through interactive dynamic web pages using AJAX, ASP.NET MVC, and
Silverlight by leveraging support of Dynamic languages like Iron Python, Iron Ruby
Build complex mathematical libraries, simulation algorithms for financial derivatives contracts, solve operation
research problems around cost optimization, maximize sales, shortest path algorithms having millions of
constraints and variables by leveraging F# to build functional libraries
Exploit the true power of multi core architecture to multiply gain on application performance through
employing parallel APIs
Host disparate framework version based .NET applications/components side by side without any runtime
issues
Visual Studio 2010 architecture modeling, lab management fills the gap in requirements, architecture and test stages
of application development cycle and helps to ensure better synch up, documentation and traceability between
various life cycle stages.
Windows Server AppFabric brings in more robustness to business logic hosting, scalability, performance, availability,
monitoring, management and will help .NET adopt in mission critical areas of enterprise.
Together .NET 4 and VS2010 helps to build robust .NET applications by providing seamless support across stages of
application life cycle development; hence enterprises should start considering it for new application development or
migration/re-engineering of existing applications as appropriate.
Further Reading
1. Infosys .NET Framework 4 blogs
http://www.infosysblogs.com/microsoft/net_40/
2. VS2010 Architecture Modeling
http://www.infosys.com/microsoft/resource-center/Documents/architecture-modeling-visual-studio.pdf
3. Dynamic Language runtime
http://www.infosys.com/microsoft/resource-center/Documents/dynamic-language-runtime.pdf
4. Functional Programming on the .NET Platform
http://www.infosys.com/microsoft/resource-center/Documents/functional-programming-platform.pdf
Bibliography
1. Forrester Research: Application platform adoption trends
http://blogs.forrester.com/application_development/2010/02/forrester-databyte-application-platform-adoption-trends.
html
2. Unity Application Block
http://msdn.microsoft.com/en-us/library/cc440954.aspx
3. .NET Framework 4
http://msdn.microsoft.com/en-us/library/w0x726c2(v=VS.100).aspx
4. Visual Studio 2010
http://www.microsoft.com/visualstudio/en-us/products
5. Windows Server AppFabric
http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx
6. Team Foundation Server
http://www.microsoft.com/visualstudio/en-us/visual-studio-events
http://www.microsoft.com/downloads/details.aspx?FamilyID=8bb22356-7dfb-4999-9d7643abddcf6eec&displaylang=en
7. Business Intelligence support in VS2010
http://connect.microsoft.com/SQLServer/feedback/details/508552/ssis-vs2010-project-type
8. Infosys Software Factory
http://www.infosys.com/microsoft/resource-center/Documents/blueprints-software-factories.pdf
9. REST
http://www.infosysblogs.com/microsoft/2009/08/how_i_explained_rest_to_a_soap.html
10. Serialization improvements with WF 4.0
http://www.dotnetconsult.co.uk/weblog2/PermaLink,guid,707e4cb9-6111-4069-96b3-596e87f2e262.aspx
11. Dynamic Languages
http://tartley.com/?p=456
12. Functional programming
http://www.defmacro.org/ramblings/fp.html
13. Somasegars blog - F# and VS2010
http://blogs.msdn.com/somasegar/archive/2009/10/09/f-in-vs2010.aspx
14. Visual Studio Lab Management
http://blogs.msdn.com/lab_management/archive/2009/05/18/vsts-2010-lab-management-basic-concepts.aspx
15. Iron Python
http://ironpython.codeplex.com/
16. Iron Ruby
http://ironruby.codeplex.com/
17. Migration guide
http://www.microsoft.com/downloads/details.aspx?FamilyID=bd94c260-b5e0-4d12-93ec53567505e685&displaylang=en
18. Oracle Database connectivity
http://blogs.msdn.com/b/adonet/archive/2009/06/15/system-data-oracleclient-update.aspx
Acknowledgements
Author would like to acknowledge the reviews and inputs from Bijoy Singhal (Bijoy.Singhal@microsoft.com), Srikantan
Sankaran (sansri@microsoft.com), Harish Ranganathan (Harish.Ranganathan@microsoft.com), Sripriya Thothadri
(Sripriya_Thothadri@infosys.com), Naveen Kumar (nkumar@infosys.com), Atul Gupta (Atulg@infosys.com),
Manish Srivastava (manishsv@infosys.com) in getting this paper published.