Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ahmed Salijee Developer Advisor

Similar presentations


Presentation on theme: "Ahmed Salijee Developer Advisor"— Presentation transcript:

1

2 Ahmed Salijee Developer Advisor http://dotnet.org.za/ahmeds

3 What This Is

4 Operating System Common Language Runtime Base Class Library ADO.NET and XML ASP.NET Web Forms Web Services Mobile Controls WindowsForms Common Language Specification VBC++C#J#… Visual Studio.NET A Look Back…

5 .NET Framework 3.5 “Servicing Release” WPF Enhancements.NET Framework 3.5 LINQLINQ WF & WCF Enhancements Add-inFrameworkAdd-inFramework WPF 3.5 A Look Back… WPFWPFWCFWCFWFWFCardSpaceCardSpace.NET Framework 3.0.NET Framework 2.0 SP1 SP1 Entity Framework ADO. NET Data Services ASP.NET MVC

6 A Look Back….NET 1.0.NET 1.1.NET 2.0 3.0 3.5.NET 4 200220032009 Beta2005-08 CLR 1.0 CLR 1.1 CLR 2.0 CLR 4 SP1

7 CLR/BCL Data Middle Tier/Services Language Enhancements User Interface Languages DLRDLR Type Equivalence VarianceVariance

8 Language - Variance, Dynamic

9 Common Language Runtime Statically-Typed C# VB Ruby Python Dynamically-Typed Why the DLR?

10 Common Language Runtime Statically-Typed C# VB Ruby Python Dynamically-Typed Dynamic Language Runtime Why the DLR?

11 Python Binder Ruby Binder COM Binder Runtime Binder.NET Dynamic Programming Dynamic Language Runtime Expression Trees Dynamic Dispatch Call Site Caching Iron Python IronRubyIronRubyC#C#VB.NETVB.NETOthers…Others…

12 Dynamically Typed Objects Calculator calc = GetCalculator(); int sum = calc.Add(10, 20); Calculator calc = GetCalculator(); int sum = calc.Add(10, 20); object calc = GetCalculator(); Type calcType = calc.GetType(); object res = calcType.InvokeMember("Add", BindingFlags.InvokeMethod, null, new object[] { 10, 20 }); int sum = Convert.ToInt32(res); object calc = GetCalculator(); Type calcType = calc.GetType(); object res = calcType.InvokeMember("Add", BindingFlags.InvokeMethod, null, new object[] { 10, 20 }); int sum = Convert.ToInt32(res); ScriptObject calc = GetCalculator(); object res = calc.Invoke("Add", 10, 20); int sum = Convert.ToInt32(res); ScriptObject calc = GetCalculator(); object res = calc.Invoke("Add", 10, 20); int sum = Convert.ToInt32(res); dynamic calc = GetCalculator(); int sum = calc.Add(10, 20); dynamic calc = GetCalculator(); int sum = calc.Add(10, 20); Statically typed to be dynamic Dynamic method invocation Dynamic conversion

13 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

14 However! Primary Interop Assemblies cause many pain points…

15 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

16 C# Language Enhancements object fileName = "Test.docx"; object missing = System.Reflection.Missing.Value; doc.SaveAs(ref fileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); object fileName = "Test.docx"; object missing = System.Reflection.Missing.Value; doc.SaveAs(ref fileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); namedRange.Find("dog", xlByRows, MatchCase: True); Named argument dynamic result = namedRange.Find(MatchCase: True, what: "dog", searchOrder: xlByRows); dynamic result = namedRange.Find(MatchCase: True, what: "dog", searchOrder: xlByRows); Arguments evaluated in order written Named arguments can appear in any order doc.SaveAs("Test.docx"); Optional Params result.ClearContents(); Late-binding through “dynamic” type

17 Co- and Contra-variance void Process(object[] objects) { … } string[] strings = GetStringArray(); Process(strings); string[] strings = GetStringArray(); Process(strings); void Process(object[] objects) { objects[0] = "Hello"; // Ok objects[1] = new Button(); // Exception! } void Process(object[] objects) { objects[0] = "Hello"; // Ok objects[1] = new Button(); // Exception! } List strings = GetStringList(); Process(strings); List strings = GetStringList(); Process(strings); void Process(IEnumerable objects) { … }.NET arrays are co-variant …but not safely co-variant Until now, C# generics have been invariant void Process(IEnumerable objects) { // IEnumerable is read-only and // therefore safely co-variant } void Process(IEnumerable objects) { // IEnumerable is read-only and // therefore safely co-variant } C# 4.0 supports safe co- and contra-variance

18 Safe Co- and Contra-variance public interface IEnumerable { IEnumerator GetEnumerator(); } public interface IEnumerable { IEnumerator GetEnumerator(); } public interface IEnumerator { T Current { get; } bool MoveNext(); } public interface IEnumerator { T Current { get; } bool MoveNext(); } public interface IEnumerable { IEnumerator GetEnumerator(); } public interface IEnumerable { IEnumerator GetEnumerator(); } public interface IEnumerator { T Current { get; } bool MoveNext(); } public interface IEnumerator { T Current { get; } bool MoveNext(); } out = Co-variant Output positions only IEnumerable strings = GetStrings(); IEnumerable objects = strings; IEnumerable strings = GetStrings(); IEnumerable objects = strings; Can be treated as less derived public interface IComparer { int Compare(T x, T y); } public interface IComparer { int Compare(T x, T y); } public interface IComparer { int Compare(T x, T y); } public interface IComparer { int Compare(T x, T y); } IComparer objComp = GetComparer(); IComparer strComp = objComp; IComparer objComp = GetComparer(); IComparer strComp = objComp; in = Contra-variant Input positions only Can be treated as more derived

19 Let’s Fix It For Once And All! string GetDescription(int x) { Contract.Requires( 0 < x ); Contract.Ensures( Contract.Result () != null ); … } string GetDescription(int x) { Contract.Requires( 0 < x ); Contract.Ensures( Contract.Result () != null ); … } Design-by-Contract meets.NET!

20 Languages Support for DLR Variance – “things work the way you expect” Code Contracts Moving towards language parity – C#/VB Functional Programming – F# Better/Easier COM Interop

21 Data Middle Tier/Services Languages Core Runtime/Class Library Enhancements User Interface CLR/BCL ParallelParallelSxS**SxS**MEFMEF

22 Parallel Enhancements

23 The Parallel Computing Initiative Letting the brightest developers solve business problems, not concurrency problems. “Concurrency for the masses”

24

25 Parallel Computing with.NET 4 Task Parallel Library (TPL) Parallel LINQ (PLINQ) Coordination Data Structures (CDS) System.Threading Improvements

26 Parallel LINQ Parallel LINQ (PLINQ) enables developers to easily leverage manycore with a minimal impact to existing LINQ programming model var q = from p in people where p.Name == queryInfo.Name && p.State == queryInfo.State && p.Year >= yearStart && p.Year <= yearEnd orderby p.Year ascending select p; var q = from p in people where p.Name == queryInfo.Name && p.State == queryInfo.State && p.Year >= yearStart && p.Year <= yearEnd orderby p.Year ascending select p;

27 MEF

28 Managed Extensibility Framework? The Managed Extensibility Framework (MEF) is a new library in 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

29 MEF Basics… Export it. Import it. Compose it.

30

31 Open/Closed Principle Software entities should be open for extension, but closed for modification.

32 Known vs. Unknown

33 CLR/BCL Middle Tier/Services Languages Data Enhancements User Interface Data Model First POCO*POCO*

34 Entity Framework – Model First and POCO

35 The next version of the Entity Framework In.NET 4.0 The next version of the Entity Framework POCO Lazy-loading Foreign Keys ObjectSet & IObjectSet Model First

36 CLR/BCL Data Languages Middle Tier Enhancements User Interface Middle Tier/Services Service Discovery Workflow v4

37

38 Moving Towards WF 4.0 Major themes in WF 4.0 include… XAML-only model Enhanced base activity library Simplifying custom activities Simplifying data flow Runtime/designer improvements

39 New Flow Chart Model Simple step-by-step model, with decisions and switches Allows you to return to previous activities in the workflow Flowcharts offer a middle ground between the sequential and state machine models

40 Arguments and Variables Flow Chart Parallel Sequence Send Message DelayDelay Receive Message Generate Order InArgument OutArgument InArgument OutArgument Process Order Send Report Variables Activities are the primitive abstraction for behavior Activities define Arguments to declare the type of data that can flow into or out of an Activity Activities are composable with other ActivitiesActivities have user-defined Variables for data storageActivities bind Arguments to in-scope Variables

41 WCF Service Discovery

42 New WCF 4.0 Features Simplified configuration Discovery Router service Improved REST support Misc. advanced features

43 Service Discovery WCF 4.0 provides two types of service discovery Clients can discover services on a local subnet (UDP-based) Clients can discover services on a larger "managed" network (beyond the local subnet) through a discovery proxy AdhocAdhocManagedManaged Enabled via the serviceDiscovery behavior, clients "discover" services using a DynamicEndpoint

44 CLR/BCL Data Middle Tier/Services Languages UI Enhancements User Interface WPFWPFASP.NETASP.NET

45 WPF – Controls and Touch

46 WPF 4 New Controls DataGrid, DatePicker etc Visual State Manager Multi-Touch Windows 7 Enhancements Tasklists (Beta 2) Dialog Boxes Text Enhancements in Beta 2

47 ASP.NET Enhancements

48 ASP.NET 4.0 ASP.NET 4.0 WebForms Control Rendering, Control IDs View State Website URLs XHTML and Accessibility AJAX Client-Side Templates, Controls and Data Binding Read/Write Database Data from the Browser Cross-Browser Compatible Not tied to ASP.NET

49 ASP.NET AJAX Client-Side Templates Client-Side Controls Client-Side Data Binding Read/Write Database Data from the Browser Cross-Browser Compatible Not tied to ASP.NET

50 AJAX 4 - Client Templates Server-Side (WebForms): Client-Side {{ Name }}

51 AJAX 4 - DataContext ASMXASMX WCFWCF ADO.NET Data Services ADO.NET ASP.NET MVC JsonResult JsonResult Etc.Etc. 1. Request 2. JSON Data DataContextDataContext 3. Modify Data 4. Save Data * DataContext includes change tracking automatically

52 Data Middle Tier/Services Languages Core Runtime/Class Library Enhancements User Interface CLR/BCL ParallelParallelSxS**SxS**MEFMEF

53 CLR InProc

54 CLR 4 - In-Process Side-By-Side.NET 2.0.NET 4.0 2.0 add-in 3.03.0 3.53.5 Host Process (i.e. Outlook) 3.0 add-in 3.5 add-in 4.0 add-in

55

56 Resources Will post on http://dotnet.org.za/ahmedshttp://dotnet.org.za/ahmeds Other breakouts will have more details

57 Related Sessions (.NET 4) WhenWhatAreaCode Mon 8:00Future Directions for Visual BasicLanguagesDTL308 Mon 17:15The State of Dynamic Languages on the Microsoft.NET Framework LanguagesDTL304 Tues 9:15Introduction to F#LanguagesDTL:319 Tues 16:15The Future of C#LanguagesDTL310 Mon 9:15The Manycore Shift: Making Parallel Computing Mainstream CLR/BCLDTL206 Tues 17:30Managed Extensibility FrameworkCLR/BCLDTL315 Tues 14:30A First Look at WCF and WF in the Microsoft.NET Framework 4.0 MiddleSOA201 Mon 17:15The ADO.NET Entity Framework 4DataDTL402 Tues 17:30An Introduction to the ADO.NET Data Services Framework v1.5 DataDTL208

58 Related Sessions (.NET 4) TImeTopicAreaCode Mon 15:45Building Scalable and Available Web Applications with the Microsoft Code Name "Velocity" WebWUX301 Tues 10:50A Lap around Microsoft ASP.NET 4.0 and Microsoft Visual Studio 2010 WebWUX203 Wed 9:00Taking AJAX to the Next Level**WebWUX306 Mon 8:00Building Rich Business Clients in WPF: New Tools and Controls for Windows Presentation Foundation ClientWUX303 Tues 13:15Microsoft Visual Studio 2010 Overview for the Business Application Developer GeneralDTL309

59 Required Slide Complete a session evaluation and enter to win! 10 pairs of MP3 sunglasses to be won

60 www.microsoft.com/teched Sessions On-Demand & Community http://microsoft.com/technet Resources for IT Professionals http://microsoft.com/msdn Resources for Developers www.microsoft.com/learning Microsoft Certification & Training Resources Resources Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online. Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online. www.microsoft.com/learning Microsoft Certification and Training Resources

61 © 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. 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. Required Slide


Download ppt "Ahmed Salijee Developer Advisor"

Similar presentations


Ads by Google