220 likes | 385 Views
Visual Studio 2010 and .NET Framework 4 Training Workshop. What’s New In .NET Framework 4. Name Title Organization Email. A Look Back…. SP1. 3.5. 3.0. .NET 1.0. .NET 1.1. .NET 2.0. .NET 4. 2002. 2003. 2005-08. 2008 CTP!. CLR 1.0. CLR 1.1. CLR 2.0. CLR 4.
E N D
What’s New In.NET Framework 4 Name Title Organization Email
A Look Back… SP1 3.5 3.0 .NET 1.0 .NET 1.1 .NET 2.0 .NET 4 2002 2003 2005-08 2008 CTP! CLR 1.0 CLR 1.1 CLR 2.0 CLR 4
What Is The .NET Framework? WPF Win Forms DLR ASP.NET WCF LINQ And more! Base Class Libraries The CLR JIT & NGEN Garbage Collector Security Model Exception Handling Loader & Binder
Base Class Library Improvements Numerics • BigInteger, Complex Data Structures • Tuple • SortedSet<T>, ISet<T> I/O • Memory-Mapped File • Unified Cancellation Model
The goal of CLR 4 In-Proc SxS Managed Extensibility Framework Working Better Together… Faster… With Fewer Bugs… DLR Integration Native/Managed Interop Threading Parallel Extensions Garbage Collection Profiling Corrupted State Exceptions Code Contracts Debugging
The goal of CLR 4 In-Proc SxS Managed Extensibility Framework Working Better Together… Faster… With Fewer Bugs… DLR Integration Native/Managed Interop Threading Parallel Extensions Garbage Collection Profiling Corrupted State Exceptions Code Contracts Debugging
Design By Contract Code Contracts introduce a way to specify contractual information that is not represented by a method or type’s signature alone.
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
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.
Why Contracts? Just because something compiles, doesn’t mean it works…
A Contract contains… public Rational(int numerator, int denominator) { Contract.Requires(denominator > 0); … } Pre-conditions - must be true before Post-conditions -must be true after public string GetPassword() { Contract.Ensures(Contract.Result<string>() != null); … return password; }
A Contract contains… Invariants - must always be true [ContractInvariantMethod] protected void ObjectInvariant() { Contract.Invariant(denominator > 0); }
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
However! Primary Interop Assemblies cause many pain points…
Go Away, PIA! • Compilers embed the portions of the interop assemblies that the add-ins actually use • Runtime ensures the embedded definitions of these types are considered equivalent
Existing Side-By-Side (SxS) 1.1 add-in 2.0 add-in 3.0 add-in 3.5 add-in 3.5 .NET 1.1 3.0 .NET 2.0 Host Process (i.e. Outlook)
In-Process Side-By-Side (SxS) 2.0 add-in 3.0 add-in 3.5 add-in 4.0 add-in 3.5 .NET 4.0 3.0 .NET 2.0 Host Process (i.e. Outlook)
The goal of CLR 4.0 In-Proc SxS Managed Extensibility Framework Working Better Together… Faster… With Fewer Bugs… DLR Integration Native/Managed Interop Threading Parallel Extensions Garbage Collection Profiling Corrupted State Exceptions Code Contracts Debugging