SlideShare uma empresa Scribd logo
1 de 59
What’s New & Hot in .NET 4.0? Jess Chadwick blog.jesschadwick.com twitter.com/jchadwick
About Me  (Only one is true) I invented the question mark. I have several published magazine articles I can swim the 100m breaststroke in under 1:30
The boring credentials… Decade of development experience Recently turned independant consultant Speaker & User Group Leader Microsoft MVP (ASP.NET) ASPInsider Writer Blog: blog.jesschadwick.com Articles: in CoDe and DevConnections magazines
What Is The .NET Framework? WPF Win Forms DLR ASP.NET WCF …and more! LINQ-to-SQL Base Class Libraries The CLR JIT & NGEN Garbage Collector Security Model Exception Handling Loader & Binder
.NET 4.0 Overview:  New & Updated CLR & Framework Platforms The CLR The Base Class Library Performance, Concurrency & Parallelization New Languages (F#, IronPython) Language Enhancements Dynamic Language Runtime Code Contracts Managed Extensibility Framework (MEF) Entity Framework WPF Windows Workflow ASP.NET ASP.NET MVC Web Forms ASP.NET AJAX
.NET 4.0 Overview:  New & Updated CLR & Framework Platforms The CLR The Base Class Library Performance, Concurrency &Parallelization New Languages Language Enhancements Dynamic Language Runtime Code Contracts Managed Extensibility Framework (MEF) Entity Framework WPF Windows Workflow ASP.NET ASP.NET MVC Web Forms ASP.NET AJAX ( Platform demos if we have time )
.NET Framework Improvements
The Goals of CLR 4 Working Better Together… Faster… With Fewer Bugs… In-Proc SxS Managed Extensibility Framework Native/Managed Interop DLR Integration Threading Parallel Extensions Garbage Collection Profiling Code Contracts Debugging Corrupted State Exceptions
Base Class Library Additions Numerics BigInteger Data Structures Tuple   (newTuple<int,int,string>(1,2,”Test”)) ISet<T>  (SortedSet<T> & HashSet<T>) I/O Memory-Mapped File
Performance, Concurrency, and Parallel Extensions Thread-safe collections  (BlockingCollection<T>, ConcurrentDictionary<T>, etc.) Task Parallel Library  (TPL) PLINQ Lazy Initializationeg:  Lazy<IEnumerable<Order>> Orders { get; set;}
Code Contracts
Design By Contract Code Contracts provide a language-agnostic and declarative way to express coding assumptions in .NET programs.
A Code Contract contains… Pre-conditions: must be true before public Rational(int numerator, int denominator) { Contract.Requires(denominator > 0);     … } Post-conditions: must be true after public string GetPassword() { Contract.Ensures(Contract.Result<string>() != null);     …     return password; }
A Code Contract contains… Invariants - must always be true [ContractInvariantMethod] protected void ObjectInvariant() { Contract.Invariant(denominator > 0); }
Code Contracts
Why are Contracts Useful? ,[object Object]
Tooling!
Pex  (research.microsoft.com/projects/pex/),[object Object]
New C# 4.0 Features Improved COM Inter-op Named and Optional Parameters Covariance and Contravariance
New VB10 Features Auto-Implemented Properties Collection Initializers Statement Lambdas Implicit Line Continuation Covariance and Contravariance
New VB10 Features Automatic Properties Collection Initializers Statement Lambdas Implicit Line Continuation Covariance and Contravariance
Covariance & Contravariance “Fix” generics
Covariance Describes the substitution of related types, such that the ordering from the more restrictive type to the less restrictive type is preserved
Covariance Describes the substitution of related types, such that the ordering from the more restrictive type to the less restrictive type is preserved class Derived : Base  { }  IEnumerable<Derived> d = new List<Derived>();  IEnumerable<Base> b = d;
Contravariance Describes the substitution of related types, such that the ordering from the more restrictive type to the less restrictive type is reversed.
Contravariance Describes the substitution of related types, such that the ordering from the more restrictive type to the less restrictive type is reversed. class Derived : Base  { }  public void DoSomething(Action<Derived> func); DoSomething((Base x) => x.Foo());
New Language Features
Emerging Language Trends
Emerging Language Trends
Introducing… F#! F# Is… ,[object Object]
Very good for computation-intensive problems, highly-parallel problems, and language-oriented programming
A first-class .NET 4.0 language, with full Visual Studio 2010 support,[object Object]
New C# 4.0 Features Improved COM Inter-op Named and Optional Parameters Covariance and Contravariance Late-binding support (via dynamic keyword) (Will show up in our demos coming up next!)
Dynamic Language Runtime
Why a “Dynamic Language Runtime”? Dynamically-Typed Ruby Python Statically-Typed VB Dynamic Language Runtime C# Common Language Runtime
.NET Dynamic Programming IronPython IronRuby C# VB.NET …whatever! Dynamic Language Runtime Expression Trees Dynamic Dispatch Call Site Caching PythonBinder RubyBinder COMBinder JScriptBinder ObjectBinder
Dynamic Language Runtime
Emerging Language Trends
Declarative Development ASP.NET Web Forms  (ASPX) XAML  (WPF & Silverlight) Code Contracts MEF!
Managed Extensibility Framework (MEF)
What is MEF? MEF is… A way to manage dependencies A way to provide extensibility in your apps A framework to encourage loose coupling and reusability A new addition to the Base Class Library  System.ComponentModel.Composition
What is MEF?  (Simple Answer) Imports and Exports
What is MEF?  (Simple Answer) Imports and Exports of components(“parts”)
What is MEF?  (Complex Answer) Imports and Exports of components(“parts”) wired together via containers
Implementing MEF…and, heck – everything else!
What’s New in the Platforms? WPF, ASP.NET, Workflow, etc!
Windows Presentation Framework (WPF)
Lots of Good Stuff for WPF Multitouch Windows 7 taskbar Windows 7 ribbon  Full Trust XBaps Cached compositions Textclarity Layout rounding ClickOnce improvements Focus mgt improvements Support for UIAccessible2 VSM integration Media element improvements Client profile Data controls Accessibility improvements Control themes Chart controls … hundreds of good bug fixes too!
Entity Framework It’s not just for databases anymore!
EF4 Enhancements Model-First Development Persistence Ignorance   (POCO support!) Application Patterns (Repository, Unit of Work, etc.) Customization of Queries & Generated Code
Windows Workflow
WF challenges today Limited support for XAML-only workflows Versioning is problematic Composition difficult or impossible Writing custom activities and managing data flow is not easy enough today Limited WCF integration and activity support No generic server host environment Bottom line: A high bar to get to enough value to make it worth the tax
Moving towards .NET 4.0 XAML-only workflows are the new default Unified model between WF, WCF, and WPF Extended base activity library Simplified WF programming model Support for arguments, variables, expressions Major improvements to WCF integration Runtime and designer improvements Hosting & management via "Dublin"
Extended base activity library .NET 4.0 comes with several new activities Microsoft is planning to ship more activities via CodePlex
New flow chart model Flowcharts offer a middle ground between the sequential and state machine models Simple step-by-step model,  with decisions and switches Allows you to return to previous activities in the workflow
Improving the Web ASP.NET MVC, Web Forms, and ASP.NET AJAX
ASP.NET MVC v.2 “Officially” part of the framework New Features for v2: Areas Data Annotations support Templated Helpers Client-Side Validation
Web Forms ,[object Object]
Fine-Grained ViewState control,[object Object]

Mais conteúdo relacionado

Mais procurados

Build a game with javascript (april 2017)
Build a game with javascript (april 2017)Build a game with javascript (april 2017)
Build a game with javascript (april 2017)
Thinkful
 

Mais procurados (20)

Web development basics (Part-3)
Web development basics (Part-3)Web development basics (Part-3)
Web development basics (Part-3)
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
 
Asp.Net MVC - Razor Syntax
Asp.Net MVC - Razor SyntaxAsp.Net MVC - Razor Syntax
Asp.Net MVC - Razor Syntax
 
WordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTOWordPress and Client Side Web Applications WCTO
WordPress and Client Side Web Applications WCTO
 
Top java script frameworks ppt
Top java script frameworks pptTop java script frameworks ppt
Top java script frameworks ppt
 
Javascript
JavascriptJavascript
Javascript
 
70-480 - Programming in HTML5 with JavaScript and CSS3
 70-480 - Programming in HTML5 with JavaScript and CSS3 70-480 - Programming in HTML5 with JavaScript and CSS3
70-480 - Programming in HTML5 with JavaScript and CSS3
 
A Minimalist’s Attempt at Building a Distributed Application
A Minimalist’s Attempt at Building a Distributed ApplicationA Minimalist’s Attempt at Building a Distributed Application
A Minimalist’s Attempt at Building a Distributed Application
 
Introduction to Java Script
Introduction to Java ScriptIntroduction to Java Script
Introduction to Java Script
 
Angular 4 and TypeScript
Angular 4 and TypeScriptAngular 4 and TypeScript
Angular 4 and TypeScript
 
AngularJS Introduction
AngularJS IntroductionAngularJS Introduction
AngularJS Introduction
 
Comapring jsp and Sevlet
Comapring jsp and SevletComapring jsp and Sevlet
Comapring jsp and Sevlet
 
Advanced AngularJS Concepts
Advanced AngularJS ConceptsAdvanced AngularJS Concepts
Advanced AngularJS Concepts
 
Live session 2 lightning web component
Live session 2 lightning web componentLive session 2 lightning web component
Live session 2 lightning web component
 
The Skinny on Slim
The Skinny on SlimThe Skinny on Slim
The Skinny on Slim
 
Introduction to Angular for .NET Developers
Introduction to Angular for .NET DevelopersIntroduction to Angular for .NET Developers
Introduction to Angular for .NET Developers
 
Web Components
Web ComponentsWeb Components
Web Components
 
Java Script An Introduction By HWA
Java Script An Introduction By HWAJava Script An Introduction By HWA
Java Script An Introduction By HWA
 
ASP.NET
ASP.NETASP.NET
ASP.NET
 
Build a game with javascript (april 2017)
Build a game with javascript (april 2017)Build a game with javascript (april 2017)
Build a game with javascript (april 2017)
 

Destaque

Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overview
bwullems
 
C# 4.0 and .NET 4.0
C# 4.0 and .NET 4.0C# 4.0 and .NET 4.0
C# 4.0 and .NET 4.0
Buu Nguyen
 
Views on building blocks
Views on building blocksViews on building blocks
Views on building blocks
Ritesh Khanna
 
.Net framework
.Net framework.Net framework
.Net framework
Arun Pal
 

Destaque (15)

Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overview
 
C# 4.0 and .NET 4.0
C# 4.0 and .NET 4.0C# 4.0 and .NET 4.0
C# 4.0 and .NET 4.0
 
Views on building blocks
Views on building blocksViews on building blocks
Views on building blocks
 
Introduction to .NET Framework
Introduction to .NET FrameworkIntroduction to .NET Framework
Introduction to .NET Framework
 
Introduction to .NET Framework and C# (English)
Introduction to .NET Framework and C# (English)Introduction to .NET Framework and C# (English)
Introduction to .NET Framework and C# (English)
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
Dotnet basics
Dotnet basicsDotnet basics
Dotnet basics
 
Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
.Net framework
.Net framework.Net framework
.Net framework
 
New Features in .Net Framework 4.0 By Nyros Developer
New Features in .Net Framework 4.0 By Nyros DeveloperNew Features in .Net Framework 4.0 By Nyros Developer
New Features in .Net Framework 4.0 By Nyros Developer
 
.NET Framework 4.0 – Changes & Benefits
.NET Framework 4.0 – Changes & Benefits .NET Framework 4.0 – Changes & Benefits
.NET Framework 4.0 – Changes & Benefits
 
Standard control in asp.net
Standard control in asp.netStandard control in asp.net
Standard control in asp.net
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
 

Semelhante a What’s New and Hot in .NET 4.0

Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
Satish Verma
 
.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep Joshi.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep Joshi
Spiffy
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
Thomas Conté
 
Net framework
Net frameworkNet framework
Net framework
sumit1503
 
.Net Overview -- Training (Lesson 1)
.Net Overview -- Training (Lesson 1).Net Overview -- Training (Lesson 1)
.Net Overview -- Training (Lesson 1)
Rishi Kothari
 

Semelhante a What’s New and Hot in .NET 4.0 (20)

Intro to VS 2010 & .Net 4.0
Intro to VS 2010 & .Net 4.0Intro to VS 2010 & .Net 4.0
Intro to VS 2010 & .Net 4.0
 
Net development
Net developmentNet development
Net development
 
DOT NET TRaining
DOT NET TRainingDOT NET TRaining
DOT NET TRaining
 
Net development
Net developmentNet development
Net development
 
Rcs project Training Bangalore
Rcs project Training BangaloreRcs project Training Bangalore
Rcs project Training Bangalore
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
.Net overview
.Net overview.Net overview
.Net overview
 
.NET Innovations and Improvements
.NET Innovations and Improvements.NET Innovations and Improvements
.NET Innovations and Improvements
 
.Net overview
.Net overview.Net overview
.Net overview
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
Overview of microsoft dot net platforms
Overview of microsoft dot net platformsOverview of microsoft dot net platforms
Overview of microsoft dot net platforms
 
.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep Joshi.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep Joshi
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NET
 
Bn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot netBn1001 demo ppt advance dot net
Bn1001 demo ppt advance dot net
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
Net framework
Net frameworkNet framework
Net framework
 
Cloud computing & .NET 4.0 overview
Cloud computing & .NET 4.0 overviewCloud computing & .NET 4.0 overview
Cloud computing & .NET 4.0 overview
 
.Net Overview -- Training (Lesson 1)
.Net Overview -- Training (Lesson 1).Net Overview -- Training (Lesson 1)
.Net Overview -- Training (Lesson 1)
 
DOT Net overview
DOT Net overviewDOT Net overview
DOT Net overview
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

What’s New and Hot in .NET 4.0

  • 1. What’s New & Hot in .NET 4.0? Jess Chadwick blog.jesschadwick.com twitter.com/jchadwick
  • 2. About Me (Only one is true) I invented the question mark. I have several published magazine articles I can swim the 100m breaststroke in under 1:30
  • 3. The boring credentials… Decade of development experience Recently turned independant consultant Speaker & User Group Leader Microsoft MVP (ASP.NET) ASPInsider Writer Blog: blog.jesschadwick.com Articles: in CoDe and DevConnections magazines
  • 4. What Is The .NET Framework? WPF Win Forms DLR ASP.NET WCF …and more! LINQ-to-SQL Base Class Libraries The CLR JIT & NGEN Garbage Collector Security Model Exception Handling Loader & Binder
  • 5. .NET 4.0 Overview: New & Updated CLR & Framework Platforms The CLR The Base Class Library Performance, Concurrency & Parallelization New Languages (F#, IronPython) Language Enhancements Dynamic Language Runtime Code Contracts Managed Extensibility Framework (MEF) Entity Framework WPF Windows Workflow ASP.NET ASP.NET MVC Web Forms ASP.NET AJAX
  • 6. .NET 4.0 Overview: New & Updated CLR & Framework Platforms The CLR The Base Class Library Performance, Concurrency &Parallelization New Languages Language Enhancements Dynamic Language Runtime Code Contracts Managed Extensibility Framework (MEF) Entity Framework WPF Windows Workflow ASP.NET ASP.NET MVC Web Forms ASP.NET AJAX ( Platform demos if we have time )
  • 8. The Goals of CLR 4 Working Better Together… Faster… With Fewer Bugs… In-Proc SxS Managed Extensibility Framework Native/Managed Interop DLR Integration Threading Parallel Extensions Garbage Collection Profiling Code Contracts Debugging Corrupted State Exceptions
  • 9. Base Class Library Additions Numerics BigInteger Data Structures Tuple (newTuple<int,int,string>(1,2,”Test”)) ISet<T> (SortedSet<T> & HashSet<T>) I/O Memory-Mapped File
  • 10. Performance, Concurrency, and Parallel Extensions Thread-safe collections (BlockingCollection<T>, ConcurrentDictionary<T>, etc.) Task Parallel Library (TPL) PLINQ Lazy Initializationeg: Lazy<IEnumerable<Order>> Orders { get; set;}
  • 12. Design By Contract Code Contracts provide a language-agnostic and declarative way to express coding assumptions in .NET programs.
  • 13. A Code Contract contains… Pre-conditions: must be true before public Rational(int numerator, int denominator) { Contract.Requires(denominator > 0); … } Post-conditions: must be true after public string GetPassword() { Contract.Ensures(Contract.Result<string>() != null); … return password; }
  • 14. A Code Contract contains… Invariants - must always be true [ContractInvariantMethod] protected void ObjectInvariant() { Contract.Invariant(denominator > 0); }
  • 16.
  • 18.
  • 19. New C# 4.0 Features Improved COM Inter-op Named and Optional Parameters Covariance and Contravariance
  • 20. New VB10 Features Auto-Implemented Properties Collection Initializers Statement Lambdas Implicit Line Continuation Covariance and Contravariance
  • 21. New VB10 Features Automatic Properties Collection Initializers Statement Lambdas Implicit Line Continuation Covariance and Contravariance
  • 22. Covariance & Contravariance “Fix” generics
  • 23. Covariance Describes the substitution of related types, such that the ordering from the more restrictive type to the less restrictive type is preserved
  • 24. Covariance Describes the substitution of related types, such that the ordering from the more restrictive type to the less restrictive type is preserved class Derived : Base { } IEnumerable<Derived> d = new List<Derived>(); IEnumerable<Base> b = d;
  • 25. Contravariance Describes the substitution of related types, such that the ordering from the more restrictive type to the less restrictive type is reversed.
  • 26. Contravariance Describes the substitution of related types, such that the ordering from the more restrictive type to the less restrictive type is reversed. class Derived : Base { } public void DoSomething(Action<Derived> func); DoSomething((Base x) => x.Foo());
  • 30.
  • 31. Very good for computation-intensive problems, highly-parallel problems, and language-oriented programming
  • 32.
  • 33. New C# 4.0 Features Improved COM Inter-op Named and Optional Parameters Covariance and Contravariance Late-binding support (via dynamic keyword) (Will show up in our demos coming up next!)
  • 35. Why a “Dynamic Language Runtime”? Dynamically-Typed Ruby Python Statically-Typed VB Dynamic Language Runtime C# Common Language Runtime
  • 36. .NET Dynamic Programming IronPython IronRuby C# VB.NET …whatever! Dynamic Language Runtime Expression Trees Dynamic Dispatch Call Site Caching PythonBinder RubyBinder COMBinder JScriptBinder ObjectBinder
  • 39. Declarative Development ASP.NET Web Forms (ASPX) XAML (WPF & Silverlight) Code Contracts MEF!
  • 41. What is MEF? MEF is… A way to manage dependencies A way to provide extensibility in your apps A framework to encourage loose coupling and reusability A new addition to the Base Class Library System.ComponentModel.Composition
  • 42. What is MEF? (Simple Answer) Imports and Exports
  • 43. What is MEF? (Simple Answer) Imports and Exports of components(“parts”)
  • 44. What is MEF? (Complex Answer) Imports and Exports of components(“parts”) wired together via containers
  • 45. Implementing MEF…and, heck – everything else!
  • 46. What’s New in the Platforms? WPF, ASP.NET, Workflow, etc!
  • 48. Lots of Good Stuff for WPF Multitouch Windows 7 taskbar Windows 7 ribbon Full Trust XBaps Cached compositions Textclarity Layout rounding ClickOnce improvements Focus mgt improvements Support for UIAccessible2 VSM integration Media element improvements Client profile Data controls Accessibility improvements Control themes Chart controls … hundreds of good bug fixes too!
  • 49. Entity Framework It’s not just for databases anymore!
  • 50. EF4 Enhancements Model-First Development Persistence Ignorance (POCO support!) Application Patterns (Repository, Unit of Work, etc.) Customization of Queries & Generated Code
  • 52. WF challenges today Limited support for XAML-only workflows Versioning is problematic Composition difficult or impossible Writing custom activities and managing data flow is not easy enough today Limited WCF integration and activity support No generic server host environment Bottom line: A high bar to get to enough value to make it worth the tax
  • 53. Moving towards .NET 4.0 XAML-only workflows are the new default Unified model between WF, WCF, and WPF Extended base activity library Simplified WF programming model Support for arguments, variables, expressions Major improvements to WCF integration Runtime and designer improvements Hosting & management via "Dublin"
  • 54. Extended base activity library .NET 4.0 comes with several new activities Microsoft is planning to ship more activities via CodePlex
  • 55. New flow chart model Flowcharts offer a middle ground between the sequential and state machine models Simple step-by-step model, with decisions and switches Allows you to return to previous activities in the workflow
  • 56. Improving the Web ASP.NET MVC, Web Forms, and ASP.NET AJAX
  • 57. ASP.NET MVC v.2 “Officially” part of the framework New Features for v2: Areas Data Annotations support Templated Helpers Client-Side Validation
  • 58.
  • 59.
  • 60. Client-Side Data Controls (DataView & DataContext)
  • 63.
  • 64.
  • 65. MEF Homepage: mef.codeplex.com
  • 66. DLR Homepage: dlr.codeplex.com
  • 67. IronPython Homepage: ironpython.codeplex.comContact Info Email: jesschadwick@gmail.com Blog: blog.jesschadwick.com Twitter: twitter.com/jchadwick

Notas do Editor

  1. BigInteger: an immutable type that represents an arbitrarily large integer whose value in theory has no upper or lower boundsTuple: a small, finite list of objects; used to pass around multiple values in one object. Kind of like a dynamic struct.ISet&lt;T&gt;:collections that have unique elements and specific operations.Memory-Mapped File: gives you ability to work with files without loading them into memory and locking them from other processes
  2. MESSAGING:Late-Binding Support: The ability to do runtime call dispatch rather than being forced into compile-time verification. Named and Optional Parameters: This allows us to clean up our code as we can see. It also goes hand-in-hand with #3, Improved COM interop (bye-bye “ref MissingValue”)Improved COM Interop: Better interop with COM, along with easier deployment via Type Equivalent and embedding of types.Covariance and Contravariance: This is really about patching a problem in our generic type system as it exists today. Most developers won’t be using the generic variance features directly, they will simply be able to do stuff they couldn’t do before.
  3. MESSAGING:We show all these features in our demo.
  4. MESSAGING:We show all these features in our demo.
  5. MESSAGING:There are several trends in modern programming languages that we feel are important to address and capture with our programming language that we will continue to target. DeclarativeImperative languages focus heavily on the how.Programming logic is achieved via if statements, for loops, while loops, etc.Declarative languages focus on the whatTell the computer “what” you want done, and let it focus on how to get it done (so the language decides whether to achieve the goal via a for loop, foreach loop, recursion, etc.)Focusing on the what instead of the “how” is an important part of “stepping away from the compiler” and better expressing your true intent in code.DynamicAround dynamic languages, you often hear the comparison of dynamically-typed versus statically-typed languages.A better way to express this difference is thinking “late-bound” versus early-bound.Early-bound languages enforce calling conventions, matching contracts (method calls on specific types, for instance), at compile time. However, late-bound languages “punt” this decision until runtime. While early-bound languages gain me benefits like compile-time type-safety, they also enforce rigid constraints on the design of your codeIn this way, code written in early-bound languages becomes more difficult to change.For more information on this “flexibility”, check out Duck Typing in Ruby.ConcurrentConcurrency is a topic that is very important to start addressing ASAP. The “concurrency problem” is already here, not 5 years from now, but today.Functional languages like F# are very powerful when it comes to addressing concurrencyThis power comes from the immutable-by-default approach when enables easier-to-parallelize code since assumptions can be made about the behavior of the code because of no shared-stateF# introduces a very powerful mechanism for achieving concurrency called Asynchronous Workflows (has nothing to do with Workflow Foundation workflows)Async Workflows use Parallel Extensions to the .NET Framework under-the-hoodFor shared-stated languages like C# and Visual Basic, concurrency features are primarily coming from library features like Parallel ExtensionsLanguage teams are thinking hard about how to possibly integrate concurrency into the core language (this is a hard space).
  6. MESSAGING:There are several trends in modern programming languages that we feel are important to address and capture with our programming language that we will continue to target. DeclarativeImperative languages focus heavily on the how.Programming logic is achieved via if statements, for loops, while loops, etc.Declarative languages focus on the whatTell the computer “what” you want done, and let it focus on how to get it done (so the language decides whether to achieve the goal via a for loop, foreach loop, recursion, etc.)Focusing on the what instead of the “how” is an important part of “stepping away from the compiler” and better expressing your true intent in code.DynamicAround dynamic languages, you often hear the comparison of dynamically-typed versus statically-typed languages.A better way to express this difference is thinking “late-bound” versus early-bound.Early-bound languages enforce calling conventions, matching contracts (method calls on specific types, for instance), at compile time. However, late-bound languages “punt” this decision until runtime. While early-bound languages gain me benefits like compile-time type-safety, they also enforce rigid constraints on the design of your codeIn this way, code written in early-bound languages becomes more difficult to change.For more information on this “flexibility”, check out Duck Typing in Ruby.ConcurrentConcurrency is a topic that is very important to start addressing ASAP. The “concurrency problem” is already here, not 5 years from now, but today.Functional languages like F# are very powerful when it comes to addressing concurrencyThis power comes from the immutable-by-default approach when enables easier-to-parallelize code since assumptions can be made about the behavior of the code because of no shared-stateF# introduces a very powerful mechanism for achieving concurrency called Asynchronous Workflows (has nothing to do with Workflow Foundation workflows)Async Workflows use Parallel Extensions to the .NET Framework under-the-hoodFor shared-stated languages like C# and Visual Basic, concurrency features are primarily coming from library features like Parallel ExtensionsLanguage teams are thinking hard about how to possibly integrate concurrency into the core language (this is a hard space).
  7. MESSAGING:F# is a functional programming language for the .NET Framework. It combines the succinct, expressive, and compositional style of functional programming with the runtime, libraries, interoperability, and object model of .NET. F# is included in Visual Studio 2010 and is now a first-class language just like Visual Basic, C#, and C++. F# is very good for compute-intensive problems, highly parallel problems, and language-oriented programming. Since F# just generates normal MSIL and .NET assemblies, you can develop a library in F# that does your computations, and call your F# code from your C# application.
  8. MESSAGING:There are several trends in modern programming languages that we feel are important to address and capture with our programming language that we will continue to target. DeclarativeImperative languages focus heavily on the how.Programming logic is achieved via if statements, for loops, while loops, etc.Declarative languages focus on the whatTell the computer “what” you want done, and let it focus on how to get it done (so the language decides whether to achieve the goal via a for loop, foreach loop, recursion, etc.)Focusing on the what instead of the “how” is an important part of “stepping away from the compiler” and better expressing your true intent in code.DynamicAround dynamic languages, you often hear the comparison of dynamically-typed versus statically-typed languages.A better way to express this difference is thinking “late-bound” versus early-bound.Early-bound languages enforce calling conventions, matching contracts (method calls on specific types, for instance), at compile time. However, late-bound languages “punt” this decision until runtime. While early-bound languages gain me benefits like compile-time type-safety, they also enforce rigid constraints on the design of your codeIn this way, code written in early-bound languages becomes more difficult to change.For more information on this “flexibility”, check out Duck Typing in Ruby.ConcurrentConcurrency is a topic that is very important to start addressing ASAP. The “concurrency problem” is already here, not 5 years from now, but today.Functional languages like F# are very powerful when it comes to addressing concurrencyThis power comes from the immutable-by-default approach when enables easier-to-parallelize code since assumptions can be made about the behavior of the code because of no shared-stateF# introduces a very powerful mechanism for achieving concurrency called Asynchronous Workflows (has nothing to do with Workflow Foundation workflows)Async Workflows use Parallel Extensions to the .NET Framework under-the-hoodFor shared-stated languages like C# and Visual Basic, concurrency features are primarily coming from library features like Parallel ExtensionsLanguage teams are thinking hard about how to possibly integrate concurrency into the core language (this is a hard space).
  9. MESSAGING:Late-Binding Support: The ability to do runtime call dispatch rather than being forced into compile-time verification. Named and Optional Parameters: This allows us to clean up our code as we can see. It also goes hand-in-hand with #3, Improved COM interop (bye-bye “ref MissingValue”)Improved COM Interop: Better interop with COM, along with easier deployment via Type Equivalent and embedding of types.Covariance and Contravariance: This is really about patching a problem in our generic type system as it exists today. Most developers won’t be using the generic variance features directly, they will simply be able to do stuff they couldn’t do before.
  10. MESSAGING:The DLR provides core services that are necessary for dynamically-typed languages to work on the CLRThe DLR also provides other services that can be used by statically-typed languages as well to achieve more dynamic behavior:Expression Trees (including Statements)Dynamic DispatchCall Site Caching
  11. MESSAGING:The power of the DLR is that there are many binders for the DLR. Yes, we can interop with dynamic languages like Python and Ruby like we expect to. However, perhaps even more importantly, there are binders available for .NET, Silverlight, and Office. This allows us to interact between these platforms in very powerful ways that we were unable to currently.
  12. MESSAGING:There are several trends in modern programming languages that we feel are important to address and capture with our programming language that we will continue to target. DeclarativeImperative languages focus heavily on the how.Programming logic is achieved via if statements, for loops, while loops, etc.Declarative languages focus on the whatTell the computer “what” you want done, and let it focus on how to get it done (so the language decides whether to achieve the goal via a for loop, foreach loop, recursion, etc.)Focusing on the what instead of the “how” is an important part of “stepping away from the compiler” and better expressing your true intent in code.DynamicAround dynamic languages, you often hear the comparison of dynamically-typed versus statically-typed languages.A better way to express this difference is thinking “late-bound” versus early-bound.Early-bound languages enforce calling conventions, matching contracts (method calls on specific types, for instance), at compile time. However, late-bound languages “punt” this decision until runtime. While early-bound languages gain me benefits like compile-time type-safety, they also enforce rigid constraints on the design of your codeIn this way, code written in early-bound languages becomes more difficult to change.For more information on this “flexibility”, check out Duck Typing in Ruby.ConcurrentConcurrency is a topic that is very important to start addressing ASAP. The “concurrency problem” is already here, not 5 years from now, but today.Functional languages like F# are very powerful when it comes to addressing concurrencyThis power comes from the immutable-by-default approach when enables easier-to-parallelize code since assumptions can be made about the behavior of the code because of no shared-stateF# introduces a very powerful mechanism for achieving concurrency called Asynchronous Workflows (has nothing to do with Workflow Foundation workflows)Async Workflows use Parallel Extensions to the .NET Framework under-the-hoodFor shared-stated languages like C# and Visual Basic, concurrency features are primarily coming from library features like Parallel ExtensionsLanguage teams are thinking hard about how to possibly integrate concurrency into the core language (this is a hard space).