Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
A Tour of .NET 4<br />Scott Hanselman<br />Principal Program Manager Lead<br />scottha@microsoft.com <br />@shanselman on ...
Cost Cuttingin VS 2010<br />
Layoffs.<br />
Layoffs.<br />
Layoffs.<br />
Layoffs.<br />
Layoffs.<br />
A Look Back…<br /><configuration><br />  <system.web><br />     <compilation debug="true”<br />targetFramework="4.0" /><br...
Web Forms 4 - Client ID<br />
Web Forms 4 - Client ID<br />
Clean HTML<br />Ability to specify client IDs on controls<br />Improves client script and CSS support<br />ClientIdMode = ...
Data Control Improvements<br /><asp:chart /> now built-into ASP.NET 4.0 <br />
Core ASP.NET Improvements<br />Cache Extensibility<br />Enable disk based caching<br />Integrate with new “Velocity” distr...
Deployment<br />End to end packaging and deploying of web applications <br />Enables customized configurations<br />Suppor...
ASP.NET Web Forms 4Client Id / Routing<br />demo<br />
Microsoft AJAX CDN<br />Free CDN hosting of AJAX library scripts<br />ASP.NET AJAX 4<br />jQuery and jQuery Validation<br ...
AJAX 4 - Client Templates<br />Server-Side (WebForms):<br /><ItemTemplate>  <li><%# Eval("Name") %></li><br /></ItemTempla...
AJAX 4 - DataContext<br />ASMX<br />1. Request<br />WCF<br />ADO.NET<br />Data Services<br />Data<br />Context<br />2. JSO...
ASP.NET AJAX 4Client Templates/Odata<br />demo<br />
ASP.NET AJAX 4Client Templates<br />demo<br />
WPF 4<br /> Data Grid<br /> Ribbon<br /> Multi-Touch<br /> Windows 7 Enhancements<br />
Managed Extensibility Framework?<br />The Managed Extensibility Framework (MEF) is a new libraryin the .NET Framework that...
Open/Closed Principle<br />Software entities should be <br />open for extension, <br />but closed for modification.<br />
Knownvs.     Unknown<br />
Client ApplicationsWPF 4 DataGrid/ MEF<br />demo<br />
Client ApplicationsWPF 4 DataGrid / MEF<br />demo<br />
The Parallel Computing Initiative<br />Letting the brightest developers solve business problems, not concurrency problems....
Parallel Computing with .NET 4<br />Task Parallel Library (TPL)<br />Parallel LINQ (PLINQ)<br />Coordination Data Structur...
Parallel LINQ<br />Parallel LINQ (PLINQ)enables developers to easily leveragemanycore with a minimal impact to existing LI...
Parallel ComputingParallel LINQ and PFX<br />demo<br />
Parallel ComputingParallel LINQ (PLINQ)<br />demo<br />
Why the DLR?<br />Dynamically-Typed<br />Ruby<br />Python<br />Statically-Typed<br />VB<br />C#<br />Common Language Runti...
Dynamically-Typed<br />Ruby<br />Python<br />Statically-Typed<br />VB<br />Dynamic Language Runtime<br />C#<br />Common La...
.NET Dynamic Programming<br />IronPython<br />IronRuby<br />C#<br />VB.NET<br />Others…<br />Dynamic Language Runtime<br /...
DLR Integration	Dynamic for all!<br />demo<br />
DLR Integration<br />demo<br />
Dynamically Typed Objects<br />Calculator calc = GetCalculator();<br />int sum = calc.Add(10, 20);<br />object calc = GetC...
Type Equivalence<br />Interop Assemblies translate between managed code and COM<br />For each interface, struct, enum, <br...
However!<br />Primary Interop Assemblies cause many pain points…<br />
Go Away, PIA!<br />Compilers embed the portions of the interop assemblies that the add-ins actually use<br />Runtime ensur...
CLR 4Type Equivalence<br />demo<br />
Upcoming SlideShare
Loading in …5
×

Lap around .net 4

701 views

Published on

Published in: Education
  • Be the first to comment

  • Be the first to like this

Lap around .net 4

  1. 1. A Tour of .NET 4<br />Scott Hanselman<br />Principal Program Manager Lead<br />scottha@microsoft.com <br />@shanselman on Twitter<br />
  2. 2. Cost Cuttingin VS 2010<br />
  3. 3. Layoffs.<br />
  4. 4. Layoffs.<br />
  5. 5. Layoffs.<br />
  6. 6. Layoffs.<br />
  7. 7. Layoffs.<br />
  8. 8. A Look Back…<br /><configuration><br /> <system.web><br /> <compilation debug="true”<br />targetFramework="4.0" /><br /> </system.web><br /></configuration><br />SP1<br />3.5<br />3.0<br />.NET 1.0<br />.NET 1.1<br />.NET 2.0<br />.NET 4<br />2002<br />2003<br />2010 RTM<br />2005-08<br />CLR 1.0<br />CLR 1.1<br />CLR 2.0<br />CLR 4<br />
  9. 9. Web Forms 4 - Client ID<br />
  10. 10. Web Forms 4 - Client ID<br />
  11. 11. Clean HTML<br />Ability to specify client IDs on controls<br />Improves client script and CSS support<br />ClientIdMode = Static, Predictable, Auto, Inherit<br />CSS rendering support<br />Remove the need to use CSS adapters<br />Defer to CSS and bypass existing style properties<br />Support non-table-based HTML rendering<br />ViewState improvements<br />Disable at app/page level, enable per control<br />
  12. 12. Data Control Improvements<br /><asp:chart /> now built-into ASP.NET 4.0 <br />
  13. 13. Core ASP.NET Improvements<br />Cache Extensibility<br />Enable disk based caching<br />Integrate with new “Velocity” distributed cache<br />Automatically Pre-Start Applications<br />Enable applications to precache/load data<br />Perf Monitoring on a per-application basis<br />Syntax for automatically HTML encoding<br /><%: Message %><br />
  14. 14. Deployment<br />End to end packaging and deploying of web applications <br />Enables customized configurations<br />Supports databases, SSL certs, custom registry entries, file ACLs, etc<br />Works great with hosted environments<br />
  15. 15. ASP.NET Web Forms 4Client Id / Routing<br />demo<br />
  16. 16.
  17. 17. Microsoft AJAX CDN<br />Free CDN hosting of AJAX library scripts<br />ASP.NET AJAX 4<br />jQuery and jQuery Validation<br /><script src=“http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js” type="text/javascript“ /><br />Built-in support with <asp:scriptmanager><br />
  18. 18. AJAX 4 - Client Templates<br />Server-Side (WebForms):<br /><ItemTemplate> <li><%# Eval("Name") %></li><br /></ItemTemplate><br />Client-Side<br /><ul class="sys-template"> <li>{{ Name }}</li><br /></ul><br />
  19. 19. AJAX 4 - DataContext<br />ASMX<br />1. Request<br />WCF<br />ADO.NET<br />Data Services<br />Data<br />Context<br />2. JSON Data<br />ASP.NET MVC<br />JsonResult<br />3. Modify <br />Data<br />4. Save Data<br />Etc.<br />* DataContext includes change tracking automatically<br />
  20. 20. ASP.NET AJAX 4Client Templates/Odata<br />demo<br />
  21. 21. ASP.NET AJAX 4Client Templates<br />demo<br />
  22. 22. WPF 4<br /> Data Grid<br /> Ribbon<br /> Multi-Touch<br /> Windows 7 Enhancements<br />
  23. 23.
  24. 24.
  25. 25. Managed Extensibility Framework?<br />The Managed Extensibility Framework (MEF) is a new libraryin 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<br />
  26. 26.
  27. 27. Open/Closed Principle<br />Software entities should be <br />open for extension, <br />but closed for modification.<br />
  28. 28. Knownvs. Unknown<br />
  29. 29. Client ApplicationsWPF 4 DataGrid/ MEF<br />demo<br />
  30. 30. Client ApplicationsWPF 4 DataGrid / MEF<br />demo<br />
  31. 31. The Parallel Computing Initiative<br />Letting the brightest developers solve business problems, not concurrency problems.<br />“Concurrency for the masses”<br />
  32. 32.
  33. 33. Parallel Computing with .NET 4<br />Task Parallel Library (TPL)<br />Parallel LINQ (PLINQ)<br />Coordination Data Structures (CDS)<br />System.Threading Improvements<br />
  34. 34. Parallel LINQ<br />Parallel LINQ (PLINQ)enables developers to easily leveragemanycore with a minimal impact to existing LINQ programming model<br />var q = from p in people<br />        where p.Name == queryInfo.Name && <br />p.State == queryInfo.State &&<br />p.Year >= yearStart &&<br />p.Year <= yearEnd<br />        orderbyp.Year ascending<br />        select p;<br />.AsParallel()<br />
  35. 35. Parallel ComputingParallel LINQ and PFX<br />demo<br />
  36. 36. Parallel ComputingParallel LINQ (PLINQ)<br />demo<br />
  37. 37. Why the DLR?<br />Dynamically-Typed<br />Ruby<br />Python<br />Statically-Typed<br />VB<br />C#<br />Common Language Runtime<br />
  38. 38. Dynamically-Typed<br />Ruby<br />Python<br />Statically-Typed<br />VB<br />Dynamic Language Runtime<br />C#<br />Common Language Runtime<br />Why the DLR?<br />
  39. 39. .NET Dynamic Programming<br />IronPython<br />IronRuby<br />C#<br />VB.NET<br />Others…<br />Dynamic Language Runtime<br />Expression Trees<br />Dynamic Dispatch<br />Call Site Caching<br />PythonBinder<br />RubyBinder<br />COMBinder<br />RuntimeBinder<br />RuntimeBinder<br />
  40. 40. DLR Integration Dynamic for all!<br />demo<br />
  41. 41. DLR Integration<br />demo<br />
  42. 42. Dynamically Typed Objects<br />Calculator calc = GetCalculator();<br />int sum = calc.Add(10, 20);<br />object calc = GetCalculator();<br />TypecalcType = calc.GetType();<br />object res = calcType.InvokeMember("Add",<br />BindingFlags.InvokeMethod, null,<br />newobject[] { 10, 20 });<br />int sum = Convert.ToInt32(res);<br />ScriptObject calc = GetCalculator();<br />object res = calc.Invoke("Add", 10, 20);<br />int sum = Convert.ToInt32(res);<br />Statically typed to be dynamic<br />dynamic calc = GetCalculator();<br />int sum = calc.Add(10, 20);<br />Dynamic method invocation<br />Dynamic conversion<br />
  43. 43. Type Equivalence<br />Interop Assemblies translate between managed code and COM<br />For each interface, struct, enum, <br />delegate, and member, contains a <br />managed equivalent with marshalling data<br />
  44. 44. However!<br />Primary Interop Assemblies cause many pain points…<br />
  45. 45. Go Away, PIA!<br />Compilers embed the portions of the interop assemblies that the add-ins actually use<br />Runtime ensuresthe embedded definitions of these types are considered equivalent<br />
  46. 46. CLR 4Type Equivalence<br />demo<br />
  47. 47. CLR 4Type Equivalence<br />demo<br />
  48. 48. .NET Framework Compatibility<br />.NET 4.0 is a highly compatible release<br />.NET 4.0 does not auto–roll forward<br />You must add a configuration file with a specific switch to get 3.5 apps to run on 4.0<br />
  49. 49. CLR 2 - Existing Side-By-Side<br />2.0 add-in<br />3.0 add-in<br />3.5 add-in<br />1.1 add-in<br />3.5<br />.NET 1.1<br />3.0<br />.NET 2.0<br />Host Process (i.e. Outlook)<br />
  50. 50. CLR 4 - In-Process Side-By-Side<br />2.0 add-in<br />3.0 add-in<br />3.5 add-in<br />4.0 add-in<br />3.5<br />.NET 4.0<br />3.0<br />.NET 2.0<br />Host Process (i.e. Outlook)<br />
  51. 51. CLR 4In-Process Side-By-Side<br />demo<br />
  52. 52. CLR 4In-Process Side-By-Side<br />demo<br />
  53. 53. Be well,write good code,and stay in touchscottha@microsoft.comhttp://hanselman.com@shanselman on Twitter<br />
  54. 54. Required Slide<br />© 2009 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.<br />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.<br />

×