360 likes | 556 Views
Dave Sussman. .NET 4.0. Agenda. Versioning Languages ASP.NET Visual Studio 2010. New version of CLR. Side by Side. 3.5. 3.0. .NET 1.0. .NET 1.1. .NET 2.0. .NET 4.0. IIS. Existing Applications. Language. Co-evolution of VB.net & C# C# Enhancements VB Enhancements
E N D
Dave Sussman .NET 4.0
Agenda • Versioning • Languages • ASP.NET • Visual Studio 2010
New version of CLR • Side by Side 3.5 3.0 .NET 1.0 .NET 1.1 .NET 2.0 .NET 4.0 IIS
Language • Co-evolution of VB.net & C# • C# Enhancements • VB Enhancements • Covariance & Contravariance • Dynamic Language Runtime
C# Enhancements • Optional Parameters public void MyFunction (string param1="a", string param2="b"){...} • Named Parameters: Print(DocumentName:"readme.txt", Width:400)
VB Enhancements (1) • Line continuation LongFunction("Iamaveryveryveryveryveryvlong", "Iamaveryveryveryveryverylong", "Iamaveryveryveryveryverylong") • Auto implemented properties: Property FilmTitle() As string
VB Enhancements (2) • Collection initializers: Dim Films as new List(of string( from {"Terminator", "Blade Runner"})) • Array Literals - following array will now be automatically typed as an integer: Dim myArray = {2, 3, 5}
VB Enhancements (3) • Jagged Arrays: Dim Movies= {({"Hot", "Heavy", "Purple"}), ({"Cold","Light"})} • Nullable Optional Parameters • Anonymous Method Support Dim add=Function(x as integer, y as integer) Return x+y End function
Variance • Variant type parameters can only be declared on interfaces and delegates • Make covariant by prefixing with the out keyword (using more specific when more general should be used) • Make contravariant by using in keyword (using more general when more specific should be used) • http://blogs.msdn.com/charlie/archive/2008/10/28/linq-farm-covariance-and-contravariance-in-visual-studio-2010.aspx
Dynamic Language Runtime • DLR runs above CLR • Works out type of object it is dealing with and where to route code
Dynamic • Allows you to work with types not known at compile time and in an intuitive and easy to read way: dynamic obj1 = new thingie(); dynamic obj2 = new stuff(); string myString; obj1.Do(myString, obj2, null);
Dynamic Code • More readable and intuitive • Allow language developers to utilize .NET • Allow .NET developers to call other frameworks • Enables Iron Ruby/Python
Easier to work with COM • No more intermediary PIA (Primary Interop Assembly) files • DLR and language enhancement make code more readable e.g. ((Excel.Range) excel.Cells[1, 1]).Value2 = "Hello"; Can now be written as: excel.Cells[1, 1].Value = "Hello"; No more: Object test (“test.docx”, missing, missing, missing, missing, missing, missing etc..)
Parallelization 256 core Task Manager Intel labs (http://www.geeks3d.com/?p=3053&cpage=1)
Parallel Programming • Most computers now multi-core • Not all code can be parallelised • Parallel version of loops • PLINQ • Tasks • Enhancements to IDE for easier debugging • New types and classes CountDownEvent, LazyInit, ConcurrentBag, LinkedList etc
Parallel Loops System.Threading.Parallel.For (0, Stocks.Count, i => { StockService.CallSomeLongRunningService (Stocks[i]); });
Tasks • New set of classes to perform work in parallel • A task is a light weight unit of work • Runs on CLR 4 thread pool • Task is a wrapper to the thread pool which is itself a wrapper to working with threads • Easy scheduling and synchronization and aggregates exceptions
Parallel Programming - Tasks Controlling order and synchronization much easier task = Task.StartNew ( Delegate { StockService.CallLongRunningService (Stocks[0]); } ); task1.Wait(); Task.WaitAll(task2, task3);
PLINQ varparallelQuery = from s in Stocks.AsParallel() let result = StockService.CallSomeLongRunningService(s) select result;
ASP.NET 4.0 • Will be included, out of the box • jQuery • Ajax Control Toolkit (partial) • Dynamic Data • MVC
ASP.NET 4.0 • Granular control of ViewState • CSS Support • Client IDs • Snippets • Ajax Client Binding • Auto-start Web applications
Proposed New Cache Functionality • A new, extensible, object cache API in its own namespace and assembly • Supports both client and server applications • Can be made available on both desktop and client SKUs • A factored version of the ASP.NET cache engine • Extensible ASP.NET output caching • Consistent APIs for programming against • Disk-based output caches • Custom object caches • Cloud-based object caches • Distributed object caches
Visual Studio 2010 • WPF Backed • Extensibility • Code adornments • Start Page
Quicker code • Generate stub’s
Highlight References • Automatically activated after few seconds • Ctrl + Shift + Up or Down
Call Hierarchy • Show all instances where method being called • Navigate methods easily
Multi targeting • Will support • 2.0, 3.0, 3.5 and 4.0 • Future versions based up 4.0 CLR • Better tool support • More features respond to targeted version • eg toolbox
Performance • Property Grid updates of controls in Designer • Website rebuild • First open of WAP • Reopen of WAP • First open a website • Reopen of a website • First open of a large solution with multiple WAPs • Reopen of a large solution with multiple WAPs • Intellisense in nuggets • Build WAP • Edit WAP and do incremental build • Full rebuild of WAP • Incremental build on website • Format HTML • Format CSS • Format JScript • Undo format HTML • Undo format CSS • Undo format JScript • First switch to DV • First drop of control onto designer • Second switch to DV • Typing text in nested HTML containers in DV • Typing text in table • Updates from SV to DV • Intellisense schema generation • Validation of markup • Add new webform • Open existing webform • First view in browser • Second view in browser • Shutting down IDE
Resources • http://www.asp.net/ • http://codeplex.com/aspnet • http://weblogs.asp.net/scottgu • http://mostlylucid.net • http://blogs.msdn.com/webdevtools/