Presentation is loading. Please wait.

Presentation is loading. Please wait.

Visual Studio 2010 and.NET Framework 4 Training Workshop.

Similar presentations


Presentation on theme: "Visual Studio 2010 and.NET Framework 4 Training Workshop."— Presentation transcript:

1 Visual Studio 2010 and.NET Framework 4 Training Workshop

2 Presentation Outline (hidden slide): Technical Level: 300 Intended Audience: Developers & Architects Objectives (what do you want the audience to take away): Understand the changes coming to the.NET Framework 4 Understand the goals of CLR 4 Presentation Outline:.NET Framework History and Packaging New BCL Improvements Code Contracts Type Equivalence/No-PIA In-Process SxS

3 What’s New In.NET Framework 4 Name Title Organization Email

4 A Look Back….NET 1.0.NET 1.1.NET 2.0 3.0 3.5.NET 4 200220032008 CTP!2005-08 CLR 1.0 CLR 1.1 CLR 2.0 CLR 4 SP1

5 What Is The.NET Framework? Base Class Libraries The CLR JIT & NGEN Garbage Collector Security Model Exception Handling Loader & Binder WPF Win Forms DLR ASP.NET WCF And more! LINQ

6 Base Class Library Improvements Numerics BigInteger, Complex Data Structures Tuple SortedSet, ISet I/O Memory-Mapped File Unified Cancellation Model

7 The goal of CLR 4 Working Better Together… Faster… With Fewer Bugs… In-Proc SxS Native/Managed Interop DLR Integration Managed Extensibility Framework Threading Parallel Extensions Garbage Collection Profiling Code Contracts Debugging Corrupted State Exceptions

8 The goal of CLR 4 Working Better Together… Faster… With Fewer Bugs… In-Proc SxS DLR Integration Parallel Extensions Garbage Collection Profiling Code Contracts Debugging Corrupted State Exceptions Managed Extensibility Framework Threading Native/Managed Interop

9 Design By Contract Code Contracts introduce a way to specify contractual information that is not represented by a method or type’s signature alone.

10 What is a Contract? A contract is… an exchange of promises between two or more parties to do, or refrain from doing, an act which is enforceable in a court of law. - Wikipedia

11 Why Contracts? There upset about that? But its the best gift in the hole world. They’re upset about that? But it’s the best gift in the whole world.

12 Why Contracts? Just because something compiles, doesn’t mean it works…

13 A 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 () != null); … return password; }

14 A Contract contains… Invariants - must always be true [ContractInvariantMethod] protected void ObjectInvariant() { Contract.Invariant(denominator > 0); }

15 Code Contracts

16 Type Equivalence Interop Assemblies translate between managed code and COM For each interface, struct, enum, delegate, and member, contains a managed equivalent with marshalling data

17 Primary Interop Assemblies cause many pain points… However!

18 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

19 No-PIA

20 Existing Side-By-Side (SxS).NET 2.0 2.0 add-in 3.0 3.5 Host Process (i.e. Outlook) 3.0 add-in 3.5 add-in 1.1 add-in.NET 1.1

21 In-Process Side-By-Side (SxS).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

22 The goal of CLR 4.0 Working Better Together… Faster… With Fewer Bugs… In-Proc SxS Native/Managed Interop DLR Integration Managed Extensibility Framework Threading Parallel Extensions Garbage Collection Profiling Code Contracts Debugging Corrupted State Exceptions

23

24 Why Compatibility Is Hard.NET Framework 1.1 was highly compatible with 1.0 Thread [] threads = new Thread[8]; for (inti=0; i<8; i++) { Worker worker = new Worker(); threads[i] = new ThreadStart(worker.Work); threads[i].Start(); worker.identity =i; } Code from an Outlook addin our executives used

25 Why Compatibility Is Hard.NET 1.1 just slightly faster for starting threads No Executives at Microsoft could use their mail Bug wasn’t our fault – but no one cares Thread [] threads = new Thread[8]; for (inti=0; i<8; i++) { Worker worker = new Worker(); threads[i] = new ThreadStart(worker.Work); threads[i].Start(); worker.identity =i; } Code from an Outlook addin our executives used


Download ppt "Visual Studio 2010 and.NET Framework 4 Training Workshop."

Similar presentations


Ads by Google