SlideServe
Menu
Préférences
© SlideServe · v2026

Visual Studio 2008 Features and Language Enhancements for Developers

mector avatar
34 diapositives · 400 Views · Jan 01, 2020

Explore Visual Studio 2008 capabilities like multitargeting, occasionally connected systems, and more. Learn C# 3.0 language enhancements such as LINQ, extension methods, and lambda expressions.

Visual Studio 2008 Features and Language Enhancements for Developers - slide 1
01 / 34Visual Studio 2008 Features and Language Enhancements for Developers
1 / 17

Télécharger la présentation

Visual Studio 2008 Features and Language Enhancements for Developers
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Fons Sonnemans (Trainer) Reflection IT fons.sonnemans@reflectionit.nl http://www.reflectionit.nl Visual Studio 2008

  2. Agenda • Multitargetting • Occasionally connected Systems • Office Applications • Client Applications • Windows Communication Foundation • ASP.NET Web Applications • C# 3.0 and LINQ

  3. Release History Visual Studio 2008 Sp1 2008 .NET 3.5 Sp1 Visual Studio 2008 Visual Studio 2008 2007 2007 .NET 3.5 .NET 3.5 Visual Studio 2005 2006 .NET 3.0 .NET 3.0 Visual Studio .NET 2003 2005 .NET 2.0 .NET 2.0 Visual Studio .NET 2003 .NET 1.1 .NET 1.1 2002 .NET 1.0 .NET 1.0

  4. Multitargetting No longer a hard link between Visual Studio and the application’s target framework .NET Fx 2.0 .NET Fx 3.0 .NET Fx 3.5 VS 2008

  5. Sync Framework & Services Connected Single data source Database driven Hard coded Monolithic & rigid Occasionally connected Multiple data sources Information based Model driven SOA

  6. ADO.NET Sync Services • No active connection to the database required • Data is persisted using SQL Server Everywhere Edition • Local Change Tracking for Sending Updates When Connected • VS2008 Developer Productivity • “Pay to Play”, RAD Component Architecture Leveraging Developers ADO.NET Knowledge • Auto Creation of Database and Table Schema Client App Sync Services SQL Server Everywhere Edition SQL Server

  7. demo { ADO.NET Sync Services}

  8. Office Applications (VSTO)

  9. Ribbon Customization • New Look and Feel for Office UI • Replaces Command Bars in “the big 5” Office apps • VSTO Ribbon Designer Group Tab Control Ribbon

  10. Custom Task & Actions Panes • VSTO simplifies and speeds up task pane UI design process with visual designers and .NET hookup • Actions Pane • More robust, easier to program alternative to Office’s built-in “Smart Document” technology • Custom Task Pane • The same general idea as Actions Pane, only on the application add-in level, not individual doc

  11. Outlook Form Region Features • New technology in Outlook 2007 for enhancing and replacing Outlook’s built-in forms • Code behind form region is implemented as COM add-in • New controls provide built-in look & feel and data binding to Outlook data

  12. demo { Office Applications}

  13. Client Applications

  14. demo { WPF Support in VS2008}

  15. WF and WCF

  16. ASP.NET Web Applications

  17. demo { WCF Support in VS2008, ASP.NET Applications}

  18. Language Features in VS 2008 Most are LINQ enablers C# 3 VB9 Anonymous Types Collection Initialisers Extension Methods Automatic Properties XML Literals Lambda expressions If Ternary Operator Relaxed Delegates Lambda statements Object Initialisers Nullable Syntax Local Type Inference Partial Methods

  19. C# 3.0: Local Variable Type Inference • Local variable type inference is a feature in C# 3.0 where you can use the var keyword instead of explicitly specifying the type of a variable. The C# 3.0 compiler makes the type of the variable match the type of the right side of the assignment. publicvoid Foo() { var i = 5; var s = "Hello"; var d = 1.0; var z; // compiler error, no initializer z = DateTime.Today; }

  20. C# 3.0: Object Initializers publicclassPoint { privateint x, y; publicint X { get { return x; } set { x = value; } } publicint Y { get { return y; } set { y = value; } } } Field or property assignments Point a = newPoint { X = 0, Y = 1 }; Point a = newPoint(); a.X = 0; a.Y = 1;

  21. C# 3.0: Anonymous Types var emp = new { Name = "Fons", Salary = 2000, DateTime.Today.Year }; var year = emp.Year; • Different anonymous object initializers that define properties with same names in the same order generate the same anonymous type classXXX { publicstring Name { get; set; } publicint Salary { get; set; } publicint Year { get; set; } }

  22. C# 3.0: Extension Methods • Extend existing types with additional methods. namespace MyStuff { publicstaticclassUtil { publicstaticbool IsWeekend(thisDateTime value) { return (value.DayOfWeek == DayOfWeek.Sunday || value.DayOfWeek == DayOfWeek.Saturday); } } } Brings extensions into scope using MyStuff; dt.IsWeekend()  MyStuff.Util.IsWeekend(dt) DateTime dt = DateTime.Today; bool b = dt.IsWeekend();

  23. C# 3.0: Lambda Expressions delegatestringSomeDelegate(string s); C# 1.x privatestaticstring TestMethod1(string s) { return s.ToUpper(); } ... SomeDelegate d1 = newSomeDelegate(TestMethod1); string a = d1("abcde"); OO Function- Pointer C# 2.0 SomeDelegate d2 = TestMethod1; string a = d2("abcde"); Delegate Inference SomeDelegate d3 = delegate(string s) { return s.ToUpper(); }; string a = d3("abcde"); C# 2.0 Anonymous Method C# 3.0 SomeDelegate d4 = s => s.ToUpper(); string a = d4("abcde"); Lambda Expression

  24. demo { C# 3.0}

  25. Language INtegrated Query? Lots of code written today in order to loop, filter, sort, group, etc. Why not build better support for this? sort sum loop

  26. Why Have LINQ? Access to common data like XML or SQL is harder than accessing in memory objects; Why not have better API’s than this? hope! pray! hope!

  27. Language Integrated Query fromdatainsomeDataSource joinotherDatainsomeOtherSource onkeyExprequalskeyExpr(intoitemName)? letsomeVariable= someExpression wheresomePredicate orderby (expression(ascending | descending)?)* selectexpression groupexpressionbykeyExpression intoitemName Language Features ( C# V3 and VB V9 ) .NET Framework V3.5 Custom Objects XML SQL

  28. How Does LINQ Work? • Compiler rewrites as method calls • No need to implement Select() etc. if myData is either IEnumerable IQueryable • Implementations already present in the .NET Framework for those cases

  29. IEnumerable & IQueryable? • IEnumerable – query is executed in memory where select Execute Execute • IQueryable – query is parsed then translated to SQL and finally executed on to the database where select Parse & Execute

  30. LINQ to SQL db.Customers.InsertOnSubmit(c1); c2.City = "Asten"; db.Customers.DeleteOnSubmit(c3); from c in db.Customers where c.City == "London" select c.CompanyName; Application IQueryable<T> Objects SubmitChanges() LINQ to SQL SQL Query or SProc Resultset DML or SProcs SQL Server SELECT CompanyName FROM Customer WHERE City = 'London' INSERT INTO Customer … UPDATE Customer …DELETE FROM Customer …

  31. demo { LINQ to Objects, LINQ to SQL}

  32. Summary • Visual Studio 2008 • Great for Windows Vista Development • Great for Client Development • Great for Web Development • Great for Database Applications Development • Great for .NET Framework v3.5 • Service Pack 1 will add even more features • ADO.NET Entity Framework • ADO.NET Data Services • ASP.NET Dynamic Data

  33. Resources • http://msdn.microsoft.com/en-us/vstudio • http://msdn.microsoft.com/en-us/sync • http://msdn.microsoft.com/en-us/office • http://windowsclient.net • http://netfx3.com/content/WCFHome.aspx • http://www.asp.net • http://msdn.microsoft.com/en-us/vcsharp • http://www.datadeveloper.net • Visual Studio 2008 Upgrade Training • http://www.reflectionit.nl/Training/default.aspx#orcas

  34. Questions mailto:fons.sonnemans@reflectionit.nl http://www.reflectionit.nl http://www.objectmap.nl