Whats New in .NET Framework 4

39
Lap Around the .NET Framework 4 Name Title Company

description

This is a ppt downloaded from microsoft where it contains the features of 2010 dot net

Transcript of Whats New in .NET Framework 4

Page 1: Whats New in .NET Framework 4

Lap Around the .NET Framework 4

NameTitleCompany

Page 2: Whats New in .NET Framework 4

A Look Back…A Look Back…

.NET 1.0 .NET 1.1 .NET 2.0

3.0

3.5

.NET 4

2002 2003 2008 CTP2005-08

CLR 1.0 CLR 1.1 CLR 2.0 CLR 4

SP1

Page 3: Whats New in .NET Framework 4

The .NET FrameworkThe .NET Framework

Base Class Libraries

The CLRJIT & NGEN

Garbage Collector

Security Model

Exception Handling

Loader & Binder

WPF Win Forms DLR ASP.NET WCF And

more!LINQ

Page 4: Whats New in .NET Framework 4

Client Applications

WPF 4MEF

Web Applications

Web Forms 4AJAX 4

Client/Server

WCF 4

Page 5: Whats New in .NET Framework 4

The Building Blocks…The Building Blocks…Parallel Computing

Task Parallel LibraryParallel LINQ

Data Access

Entity Framework 4Data Services 1.5

Runtime

DLR IntegrationType EquivalenceIn-Process SxS

Page 6: Whats New in .NET Framework 4

Web Forms 4 - Client IDWeb Forms 4 - Client ID

1) User Control (No ID)

2) User Control (“HeaderForm”)

Control Hierarchy3) Drop Down List (“States”)

Resulting Client IDs:1) ctl002) ctl00_HeaderForm3) ctl00_HeaderForm_States

Page 7: Whats New in .NET Framework 4

Web Forms 4 - RoutingWeb Forms 4 - Routing

Request:Products/Bikes

ASP.NET Routing

Route:Product/{name} -> Product.aspx

WebForms Page

File Name:Product.aspx

Route Values:Name = “Bikes”

Response

Page 8: Whats New in .NET Framework 4

ASP.NET WEB FORMS 4CLIENT ID / ROUTING

ASP.NET WEB FORMS 4CLIENT ID / ROUTING

Page 9: Whats New in .NET Framework 4

AJAX 4 - Client TemplatesAJAX 4 - Client Templates

Server-Side (WebForms):<ItemTemplate>

<li><%# Eval("Name") %></li></ItemTemplate>

Client-Side<ul class="sys-template">

<li>{{ Name }}</li></ul>

Page 10: Whats New in .NET Framework 4

AJAX 4 - DataContextAJAX 4 - DataContext

* DataContext includes change tracking automatically

ASMX

WCF

ADO.NETData Services

ASP.NET MVCJsonResult

Etc.

1. Request

2. JSON DataData

Context

3. Modify Data 4. Save Data

Page 11: Whats New in .NET Framework 4

ASP.NET AJAX 4CLIENT TEMPLATES /

DATACONTEXT

ASP.NET AJAX 4CLIENT TEMPLATES /

DATACONTEXT

Page 12: Whats New in .NET Framework 4

WPF 4WPF 4

Data Grid

Ribbon

Multi-Touch

Windows 7 Enhancements

Page 13: Whats New in .NET Framework 4

Managed Extensibility Framework?

Managed Extensibility Framework?

The Managed Extensibility Framework (MEF) is a new library in the .NET Framework that enables greater reuse of applications and components. Using MEF, .NET applications can make the shift from being statically compiled to dynamically composed

Page 14: Whats New in .NET Framework 4

Open/Closed PrincipleOpen/Closed Principle

Software entities should be open for extension,

but closed for modification.

Page 15: Whats New in .NET Framework 4

Known vs. Unknown

Page 16: Whats New in .NET Framework 4

CLIENT APPLICATIONSWPF 4 DATAGRID / MEF

CLIENT APPLICATIONSWPF 4 DATAGRID / MEF

Page 17: Whats New in .NET Framework 4

Entity Framework 4Entity Framework 4

Model-First

POCO

Lazy Loading

Foreign Keys

Page 18: Whats New in .NET Framework 4

A lot of new for WF/WCF 4A lot of new for WF/WCF 4

XAML-only workflows are the new defaultUnified model between WF, WCF, and WPF

Extended base activity librarySimplified WF programming modelSupport for arguments, variables, expressionsMajor improvements to WCF integrationRuntime and designer improvementsService discovery for WCFHosting & management via "Dublin“

Page 19: Whats New in .NET Framework 4

ADO.NET Data Services 1.5ADO.NET Data Services 1.5

Server EnhancementsRow countServer-side pagingFriendly feedsBLOB streams

Client EnhancementsRow CountWPF/SL data binding

Page 20: Whats New in .NET Framework 4

ADO.NET DATA SERVICESROW COUNT AND SERVER-SIDE

PAGING

ADO.NET DATA SERVICESROW COUNT AND SERVER-SIDE

PAGING

Page 21: Whats New in .NET Framework 4

The Parallel Computing Initiative

The Parallel Computing Initiative

Letting the brightest developers solve business problems, not concurrency problems.

“Concurrency for the masses”

Page 22: Whats New in .NET Framework 4

Parallel Computing with .NET 4Parallel Computing with .NET 4

1. Task Parallel Library (TPL)

2. Parallel LINQ (PLINQ)

3. Coordination Data Structures (CDS)

4. System.Threading Improvements

Page 23: Whats New in .NET Framework 4

Parallel LINQParallel LINQ

Parallel LINQ (PLINQ) enables developers to easily leverage manycore with a minimal impact to existing LINQ programming model

var q = from p in people        where p.Name == queryInfo.Name && p.State == queryInfo.State && p.Year >= yearStart && p.Year <= yearEnd        orderby p.Year ascending        select p;

.AsParallel()

Page 24: Whats New in .NET Framework 4

PARALLEL COMPUTINGPARALLEL LINQ (PLINQ)

PARALLEL COMPUTINGPARALLEL LINQ (PLINQ)

Page 25: Whats New in .NET Framework 4

Why the DLR?Why the DLR?

Common Language Runtime

Statically-Typed

C#VB

RubyPython

Dynamically-Typed

Page 26: Whats New in .NET Framework 4

Why the DLR?Why the DLR?

Common Language Runtime

Statically-Typed

C#VB

RubyPython

Dynamically-Typed

Dynamic Language Runtime

Page 27: Whats New in .NET Framework 4

.NET Dynamic Programming.NET Dynamic Programming

PythonBinder

RubyBinder

COMBinder

JScriptBinder

ObjectBinder

Dynamic Language Runtime

Expression TreesDynamic Dispatch

Call Site Caching

IronPython

IronRuby C# VB.NET Others…

Page 28: Whats New in .NET Framework 4

Dynamically Typed ObjectsDynamically Typed Objects

Calculator calc = GetCalculator();int sum = calc.Add(10, 20);

object calc = GetCalculator();Type calcType = calc.GetType();object res = calcType.InvokeMember("Add", BindingFlags.InvokeMethod, null, new object[] { 10, 20 });int sum = Convert.ToInt32(res);

ScriptObject calc = GetCalculator();object res = calc.Invoke("Add", 10, 20);int sum = Convert.ToInt32(res);

dynamic calc = GetCalculator();int sum = calc.Add(10, 20);

Statically typed to be dynamic

Dynamic method invocation

Dynamic conversion

Page 29: Whats New in .NET Framework 4

DLR INTEGRATIONDLR INTEGRATION

Page 30: Whats New in .NET Framework 4

Type EquivalenceType Equivalence

Interop Assemblies translate between managed code and COM

For each interface, struct, enum, delegate, and member, contains a

managed equivalent with marshalling data

Page 31: Whats New in .NET Framework 4

However!However!

Primary Interop Assemblies cause many

pain points…

Page 32: Whats New in .NET Framework 4

Go Away, PIA!Go Away, PIA!

1. Compilers embed the portions of the interop assemblies that the add-ins actually use

2. Runtime ensures the embedded definitions of these types are considered equivalent

Page 33: Whats New in .NET Framework 4

CLR 4TYPE EQUIVALENCE

CLR 4TYPE EQUIVALENCE

Page 34: Whats New in .NET Framework 4

.NET Framework Compatibility.NET Framework Compatibility

.NET 4.0 is a highly compatible release

.NET 4.0 does not auto–roll forwardYou must add a configuration file with a specific switch to get 3.5 apps to run on 4.0

Page 35: Whats New in .NET Framework 4

.NET Framework Compatibility.NET Framework Compatibility

Hang on… if 4.0 is compatible, why not run 3.5 apps automatically on 4.0?

The BEST thing is always to prefer running on the version of the framework you built against

Contact [email protected] and submit your app for testing!

Page 36: Whats New in .NET Framework 4

CLR 2 - Existing Side-By-SideCLR 2 - Existing Side-By-Side

Host Process (i.e. Outlook)

.NET 2.0

2.0 add-in

3.0

3.5

3.0 add-in

3.5 add-in

1.1 add-in

.NET 1.1

Page 37: Whats New in .NET Framework 4

CLR 4 - In-Process Side-By-Side

CLR 4 - In-Process Side-By-Side

.NET 2.0.NET 4.0

2.0 add-in

3.0

3.5

Host Process (i.e. Outlook)

3.0 add-in

3.5 add-in

4.0 add-in

Page 38: Whats New in .NET Framework 4

QUESTIONS?QUESTIONS?

Page 39: Whats New in .NET Framework 4

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED

OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.