Presentation is loading. Please wait.

Presentation is loading. Please wait.

Välkommen till Sommarkollo 2007 2006. VISUAL STUDIO 2008.

Similar presentations


Presentation on theme: "Välkommen till Sommarkollo 2007 2006. VISUAL STUDIO 2008."— Presentation transcript:

1 Välkommen till Sommarkollo 2007 2006

2 VISUAL STUDIO 2008

3 Agenda  Target vista &.NET 3.0  Handle Data  Microsoft Office  New Web Experience  ALM

4 Wanna’ see a movie?  Friday the 6’th  15.00  Kista Centrum  100 seats for free

5

6 Visual Studio ”Orcas” JScript IntelliSense WPF and WCF visual designers “My” support for.NET Framework 3.0 VSTS support for device development VSTO for 2007 Office system Language-integrated query (LINQ) Windows Vista debugging & profiling MFC for Windows Vista Office Ribbon controls Load Test Modeler Full AJAX support Diagnostics support for WCF applications Test-driven profiling Tools for DB Pros Support for distributed teams VB, XAML,and XML Refactoring

7 Framework Multitargeting  Choose which Framework version to target when building an application .NET Framework 2.0 (Whidbey) .NET Framework 3.0 (Vista) .NET Framework 3.5 (Orcas)  VS IDE only shows feature appropriate for your selected target version  Toolbox, Add New Item, Add Reference, Add Web Reference, Intellisense, etc

8 Framework Multitargeting

9

10 .NET Fx 2.0.NET Fx 2.0 Update.NET Fx 2.0 Update.NET Fx 2.0 Update.NET Fx 3.0 Update.NET Fx 3.0 Update.NET Fx 3.5 Whidbey Vista Orcas time Version = Assembly references + compilers No new CLR runtime Framework Multitargeting

11  Framework 2.0 – no framework 3.0 required  Raw Vista Box – no Framework 3.5  Enhanced scenarios – LINQ, AJAX, full framework 3.5  Easy upgrade for current VS2005 Developers  Not available in Express SKUs Multi-targeting Scenarios

12 Target vista &.NET 3.0

13 Target Vista – C++  Prepare for UAC – User Account Control  Embed manifest through property in project  Leverage new controls  Task Dialog  Command Link  Split Button  Network Address  Sys Link  Use Aero style and appearance in your applications  http://msdn.microsoft.com/msdnmag/issues/07/06/Cpp/

14  Visual Designer for WPF creates a seamless designer/developer workflow with Expression Blend  XAML-based editing directly in the IDE  Changes reflected in the designer in realtime  Control extensibility  Project templates, debugger & deployment support  Side-by-side support for Winforms  ElementHost in Toolbox  ClickOnce deployment support for WPF apps Windows Presentation Foundation

15  Autohost for the hosting of WCF services  WSDL test client allows message injection (beta 2)  Hosting Wizard eases migration of services  New WCF Project templates include both the Autohost and Test Client into an out-of-the-box F5 experience  Simple item template for adding WCF services to an existing Project Windows Communication & Windows Workflow Foundation

16

17  Activities to consume WCF services  Function similarly to the InvokeWebService activity available today  Hosting extensions to expose WF workflows as WCF services  Messaging activities (send, receive)  A workflow hosting environment to handle instantiation and message routing

18 Mobile Development  Works side-by-side with Visual Studio 2005  In-box support for Windows Mobile 5.0 SDKs  Unit Testing Integration with Visual Studio Team System  Security Aware IDE  Device Emulator 3.0

19 Create unit tests for device applications using the VSTS Unit Test infrastructure

20 Ability to target multiple versions of the.NET Compact Framework runtime

21 Device Security Manager makes it easy to deal with complex device security settings Better understand current device security settings Easy to change the device into a specific security setting to test application under different security profiles

22 Device emulator offers the ability to emulate new hardware peripherals Device emulator emulating Windows Embedded CE 6.0 operating system

23 Emulating a low battery scenario. This feature is very helpful for device developers to see how their application will behave in a low battery scenario on a real device

24 Core Language Enhancements

25 Extension Methods namespace MyStuff { public static class Extensions { public static string Concatenate(this IEnumerable strings, string separator) {…} } using MyStuff; string[] names = new string[] { "Axel", "Mia", "Niels" }; string s = names.Concatenate(", "); Extension method Brings extensions into scope obj.Foo(x, y)  XXX.Foo(obj, x, y) IntelliSense!

26 Object Initializers public class Point { private int x, y; public int X { get { return x; } set { x = value; } } public int Y { get { return y; } set { y = value; } } } Point a = new Point { X = 0, Y = 1 }; Point a = new Point(); a.X = 0; a.Y = 1; Field or property assignments

27 Collection Initializers List numbers = new List { 1, 10, 100 }; Must implement IEnumerable List numbers = new List (); numbers.Add(1); numbers.Add(10); numbers.Add(100); Must have public Add method Dictionary spellings = new Dictionary { { 0, "Zero" }, { 1, "One" }, { 2, "Two" }, { 3, "Three" } }; Add can take more than one parameter

28 IEnumerable phoneListQuery = from c in customers where c.State == "WA" select new Contact { Name = c.Name, Phone = c.Phone }; Anonymous Types public class Contact { public string Name; public string Phone; } +

29 var phoneListQuery = from c in customers where c.State == "WA" select new { Name = c.Name, Phone = c.Phone }; Anonymous Types class XXX { public string Name; public string Phone; } IEnumerable foreach (var entry in phoneListQuery) { Console.WriteLine(entry.Name); Console.WriteLine(entry.Phone); } XXX

30 Expression Trees Code as Data Predicate test = c => c.State == "WA"; Predicate test = new Predicate (XXX); private static bool XXX(Customer c) { return c.State == "WA"; } public delegate bool Predicate (T item);

31 Expression Trees Code as Data Expression > test = c => c.State == "WA"; public delegate bool Predicate (T item); ParameterExpression c = Expression.Parameter(typeof(Customer), "c"); Expression expr = Expression.Equal( Expression.Property(c, typeof(Customer).GetProperty("State")), Expression.Constant("WA") ); Expression > test = Expression.Lambda >(expr, c);

32 Automatic properties public class Product { public string Name; public decimal Price; }

33 Automatic properties public class Product { string name; decimal price; public string Name { get { return name; } set { name = value; } } public decimal Price { get { return price; } set { price = value; } }

34 Automatic properties public class Product { public string Name { get; set; } public decimal Price { get; set; } } private string □; public string Name { get { return □; } set { □ = value; } } Must have both get and set

35 C# 3.0 Language Innovations var contacts = from c in customers where c.State == "WA" select new { c.Name, c.Phone }; var contacts = customers.Where(c => c.State == "WA").Select(c => new { c.Name, c.Phone }); Extension methods Lambda expressions Query expressions Object initializers Anonymous types Local variable type inference

36 Handle Data

37 Problem: Data != Objects

38 The LINQ Project Objects XML.NET Language Integrated Query C# 3.0VB 9.0Others… Relational LINQ to Objects LINQ to SQL LINQ to XML LINQ to Entities LINQ to DataSets

39 LINQ Operators RestrictionWhere ProjectionSelect, SelectMany OrderingOrderBy, ThenBy GroupingGroupBy JoinsJoin, GroupJoin QuantifiersAny, All PartitioningTake, Skip, TakeWhile, SkipWhile SetsDistinct, Union, Intersect, Except ElementsFirst, Last, Single, ElementAt AggregationCount, Sum, Min, Max, Average ConversionToArray, ToList, ToDictionary CastingOfType, Cast

40 SqlConnection c = new SqlConnection(…); c.Open(); SqlCommand cmd = new SqlCommand( @"SELECT c.Name, c.Phone FROM Customers c WHERE c.City = @p0" ); cmd.Parameters.AddWithValue("@po", " London " ); DataReader dr = c.Execute(cmd); while (dr.Read()) { string name = dr.GetString(0); string phone = dr.GetString(1); DateTime date = dr.GetDateTime(2); } dr.Close(); Data Access In APIs Today

41 Data Access with LINQ public class Customer { public int Id; public string Name; public string City; public string Phone; } ---------------------------- GridView1.DataSource = from customer in db.Customers where customer.City == " London" select customer; GridView1.DataBind();

42 LINQ Architecture Objects XMLRelational LINQ enabled data sources LINQ enabled ADO.NET

43 LINQ Basics  Query Operators can be used against any.NET collection (IEnumerable )  Built-in examples: Select, Where, GroupBy, Join, etc.  Extensibility model supports adding/replacing them  Query Expressions can operate on information sources and apply query operators against them to return IEnumerable sequences

44 Searching/Sorting an Array string [] cities = { “Auckland”, “Oslo”, “Sydney”, “Seattle”, “Paris”, “Los Angeles” }; IEnumerable places = from city in cities where city.Length > 5 orderby city descending select city; GridView1.DataSource = places; GridView1.DataBind();

45 Projections  Sometimes you want to modify or transform the data you return from a query  LINQ enables powerful “data shaping” scenarios using projections  Can optionally be used in conjunction with new “anonymous type” compiler support

46 Projections w/ Anonymous Types List cities = CityUtilityHelper.GetCities(); var places = from city in cities where city.DistanceFromSeattle > 1000 select new { City = city.Name, Country = city.Country, DistanceInKm = city.DistanceFromSeattle * 1.61 }; GridView1.DataSource = places; GridView1.DataBind();

47 Projections w/ Anonymous Types

48 LINQ for SQL  Maps.NET classes to relational SQL data  Translates LINQ queries to SQL execution  Supports change tracking for insert, update, delete operations  Built on top of ADO.NET and integrates with connection-pooling and transactions

49 LINQ for SQL Basics public partial class Product { public int ProductID; public string ProductName; public Nullable SupplierID; public Nullable CategoryID; } public class NorthwindDataContext : DataContext { public Table Products; } NorthwindDataContext db = new NorthwindDataContext(); DataList1.DataSource = from product in db.Products where product.UnitsInStock > 0 select product; DataList1.DataBind();

50 PK/FX Relationships in Database Products TableSuppliers Table Categories Table

51 Associations in the O-R Designer

52 Code Associations in Model public partial class Product { public int ProductID; public string ProductName; public Nullable SupplierID; public Nullable CategoryID; public Supplier Supplier; public Category Category; } public partial class Supplier { public int SupplierID; public string CompanyName; public EntitySet Products; } public partial class Category { public int CategoryID; public EntitySet Products; }

53 Programming XML today… XmlDocument doc = new XmlDocument(); XmlElement contacts = doc.CreateElement("contacts"); foreach (Customer c in customers) if (c.Country == "USA") { XmlElement e = doc.CreateElement("contact"); XmlElement name = doc.CreateElement("name"); name.InnerText = c.CompanyName; e.AppendChild(name); XmlElement phone = doc.CreateElement("phone"); phone.InnerText = c.Phone; e.AppendChild(phone); contacts.AppendChild(e); } doc.AppendChild(contacts); Great Lakes Food (503) 555-7123 … Imperative model Document centric No integrated queries Memory intensive

54 LINQ to XML XElement contacts = new XElement("contacts", from c in customers where c.Country == "USA" select new XElement("contact", new XElement("name", c.CompanyName), new XElement("phone", c.Phone) ) ); Declarative model Element-centric Integrated queries Smaller and faster

55 ADO.NET vNext  Data as Objects  The Entity Data Model (EDM), which allows developers to model data at a higher level of abstraction  Client-views/mapping engine to map to and from store schemas  Full query support over EDM schemas using Entity SQL and LINQ  Open provider model that allows other stores to plug into the ADO.NET Entity Framework  Data Integration to core languages  Language-Integrated Query (LINQ)  LINQ to Entities: formulate queries using LINQ against your EDM schemas  LINQ to DataSet: the DataSet with full query capabilities  LINQ queries can go against one or more DataTable objects

56 ADO.NET Entity Framework (1/2)  "Client Views" map existing relational schema to a rich conceptual entity model  Conceptual entity model exposes concepts that make sense to your application  Different apps may have different views of the same data  Application and storage schemas may evolve independently  Exposed as an "Entity Client" ADO.NET Data Provider  Common, familiar ADO.NET Programming pattern Compatible with existing applications/tools  Canonical Entity SQL “eSQL” used to query Conceptual Model  Supports 3rd party ADO.NET Data Providers

57 ADO.NET Entity Framework (2/2)  Entities presented as CLR Objects  Work with higher level "ObjectContext" Tracks object identity, changes  Query through Entity SQL or LINQ queries  Entity Data Model Designer  Integrated into the Orcas IDE  Create entities from scratch or generate EDM models from an existing database  Easily consume existing EDM models

58 Sync Services for ADO.NET  Simplifying the Client “Golden Nugget”  Application works against a local data cache and periodically synchronizes with the server  Experience unchanged on lost connectivity  “Want local caching, but can’t spend time getting the basics right”  All the heavy lifting handled by the Framework  “Want to leverage/extend your my ADO.NET knowledge”  “Want to build real world N tier Application”  Sync via services with pluggable proxy/service  Server Data Components can use any ADO.net Provider  Application supports Occasionally Connected Scenarios

59 Sync Component Architecture Data Forms SyncAgent Data Access Work against local database Sync keeps the local and remote stores in sync Can push changes directly or via services SyncTable SyncAdaptercommands SyncAdapter ServerSyncProvider DBCommand SQL Server Compact Edition 3.5 Transport Service ServiceProxy Client SyncProvider SyncGroup Server DB

60 Guidance for LINQ to Relational Data  LINQ to SQL  Emphasis on rapid application development  Direct mapping to Microsoft SQL Server family of databases  Available in Orcas  LINQ to Entities  Focus on enterprise-grade data scenarios  Flexible mapping to relational data  Access to Microsoft SQL Server family and other databases through ADO.NET provider model  Available in first half of 2008 CTP’s and Betas on top of Orcas releases through 2007

61 Microsoft Office

62 Visual Studio Tools for Office - “Orcas”  Strategic platform infrastructure based on.NET 3.0 & Managed Add-In Foundation (MAF)  Highly-streamlined developer experience  New designers: ribbon, custom task pane, Outlook form region  ClickOnce deployment and security  Document-level solutions  Word, Excel, InfoPath: 2003 onwards  Managed controls on the document surface  Doc-level Actions Pane  ServerDocument – manipulate documents without automating Office  Word content control support

63 Visual Studio Tools for Office - “Orcas”  Application-level add-Ins  Application domain isolation  Remote updateability  All 2007 Office system apps  App-level custom task pane  Ribbon customization  Support for legacy “Shared Add-ins”

64 Workflow without VS2008  Create workflow in Visual Studio 2005  Author the feature definition file  Add GUID  Add title  Add description  Add manifest location  Author workflow template definition file  Add GUID  Add name  Add description  Compile the workflow files into a.NET assembly  Sign the assembly  Add key file  Design the actual workflow, add code etc. (This is the “real” developer task)  Install assembly into the Global Assembly Cache  Extract public key token  Add key token to workflow template definition file  Deploy feature definition file to SharePoint file system  Deploy workflow definition file to SharePoint file system  Reset Internet Information Services  Press F5  Attach to WPW3.exe process  Associate workflow with document library

65 Workflow with VS2008  Create workflow in Visual Studio Tools for Office “Orcas”  Design the actual workflow, add code etc. (This is the “real” developer task)  Press F5

66 New Web Experience

67 “Orcas” Web Tools Objectives  Address top customer issues in VS 2005  Reduce cost and increase effectiveness of Web UI design  Enabling developers & designers to program "AJAX-style" interactive web user interfaces  Programming model and design experience around language/data access (LINQ)  Best tool for the Vista platform (WCF, IIS7)

68 Design Surface  WYSIWYG layout  CSS editing experience  CSS Properties Window  Direct Style Application  Style Management Tool Windows  WYSIWYG Positioning Support  Split View  Nested Master Pages Support

69 Design Surface

70 Enabling AJAX for Developers Goals  Enable highly interactive AJAX Web apps  Retain the ease of the ASP.NET model  Powerful tools for AJAX client development Key Features  Jscript IntelliSense and Editor Support  Jscript Debugging Support

71 JScript Editor Support  Intellisense experience for JScript  Better Jscript language IntelliSense Type inferencing, Script library includes  IntelliSense against ASP.NET AJAX class model  IntelliSense against Web service proxies ASMX and WCF Services ASP.NET Services (e.g. Membership, Roles, Profile)  Rich editor support  Syntax validation (squiggles)  Formatting and colorization

72 JScript Debugging  IE Developer Improvements  Switch to enable script debugging  HTTP trace in developer toolbar  Visual Studio improvements  Move Script Explorer to Solution Explorer Breakpoints in ASPX map to rendered HTML Filter properties, methods, events in watch window

73 XML IDE support and Tools  XSLT Debugger  Enables Input Data Breakpoints allowing the user to break the execution of the style-sheet whenever a certain node in input document is hit.  IDE  Improves the experience a user has when working with an XML Schema in textual and graphical mode at the same time

74 ALM

75 Visual Studio Team System  New scenarios  Improved Development Productivity Code metrics, ‘hotpathing’, base-lining  Load Testing Enhancements Improved load modeling, reporting, graphing  Continuous Integration Build Queuing, Queue Management, Drop Management  Version Control Enhancements  Lower adoption blockers  TFS Deployment & Administration  Migration Toolkit

76 Metric: Class Coupling # of Dependencies Between Types

77 Metric: Class Inheritance # of Base Types

78 Metric: Lines of Code # of Executing Lines of Code 1234512345 static class Program { #region Application Entry Point /// /// The main entry point for the application. /// [STAThread] static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Workflow(args); } #endregion #region Static Methods /// Primary workflow for the application. /// Command line arguments. private static void Workflow(string[] cmdargs) { // Collect the list of command line arguments List args = new List (cmdargs); // Show usage syntax if the user so asks if (UseArg(args, "/?")) { ShowAbout(); return; }

79 Metric: Cyclomatic Complexity # of Branches 1 2 3 4 5 6,7 8 9 10 11 bool ParseCommandLine(string[] args) { if (args.Length == 0) ShowHelp(); return; for (int i = 0; i < args.Length; i++) switch (args[i]) { case "/?" : ShowHelp(); return false; case "/input" : if (args.Length > i && File.Exists(args[i + 1])) InputFile = args[i++]; break; case "/c" : Colapse = true; break; } return true; }

80 Metric: Maintainability Index  Overall indication of complexity by aggregation of several factors [Carnegie 1]  Lines of Code  Cyclomatic Complexity  Computational Complexity [Halstead 1]  Used on the Windows Code Base [Halstead 1] Halstead, Maurice H. Elements of Software Science, Operating, and Programming Systems Series Volume 7. New York, NY: Elsevier, 1977. Maintainability Index = 171 - 5.2 * log 2 (Halstead Volume) - 0.23 * (Cyclomatic Complexity) - 16.2 * log 2 (Lines of Code) [Carnegie 1] Carnegie Mellon University, Software Engineering Institute, Maintainability Index Technique for Measuring Program Maintainability, http://www.sei.cmu.edu/str/descriptions/mitmpm.html

81 Resources  Web  http://ajax.asp.net  http://msdn.microsoft.com/vcsharp/default.aspx  Blogs  http://blogs.msdn.com/msbuild  http://blogs.msdn.com/vbteam  http://blogs.msdn.com/adonet  http://blogs.msdn.com/johanl  http://blogs.msdn.com/pahlberg

82


Download ppt "Välkommen till Sommarkollo 2007 2006. VISUAL STUDIO 2008."

Similar presentations


Ads by Google