Getting Ready for Visual Studio 2005

Slides:



Advertisements
Similar presentations
1 Visual C# "Whidbey": Language Enhancements Anders Hejlsberg Distinguished Engineer Microsoft Corporation Anders Hejlsberg Distinguished.
Advertisements

CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics C# Language &.NET Platform 12 th -13 th Lecture Pavel Ježek.
DEV340 Microsoft Visual C# Under the Covers: An In-Depth Look at C# 2.0 Anders Hejlsberg Distinguished Engineer Microsoft Corporation.
Overview of Visual C# 2005 Henrik Westergaard Hansen
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
The Microsoft Technical Roadshow 2006 Welcome and Introduction Kevin McDaniel Developer & Platform Evangelism Group Microsoft Ltd
C#.NET C# language. C# A modern, general-purpose object-oriented language Part of the.NET family of languages ECMA standard Based on C and C++
What’s New for Smart Client Developers in Visual Studio 2005? Mike Pelton Systems Engineer Microsoft Ltd
What’s Completely New? Visual Studio Team System! Sean Puffett Developer Evangelist
What’s New for Smart Client Developers in Visual Studio 2005? Mike Pelton Systems Engineer Microsoft Ltd
C#C# C#C# Kit Colbert Student Consultant representing Microsoft
What’s New in Visual Studio 2005: Security &.NET Framework 2.0 Mike Pelton Developer & Platform Group Microsoft Ltd.
Iterator Pattern Dr. Neal CIS 480. Iterator An iterator pattern can be used when one class is a collection of things and would like to provide a standardized.
ASP.NET Programming with C# and SQL Server First Edition
Pedro Miguel Rosa Senior Software Engineer Developer Platform Group.
Enabling Better Software through Better Testing Jason Anderson, Microsoft
Eric Vogel Software Developer A.J. Boggs & Company.
Новости в.NET CLR 2.0 Светлин Наков Българска асоциация на разработчиците на софтуер.
DEV485.NET CodeDOM demystified Beat Schwegler Architect Evangelist.NET Developer Group Microsoft Corporation.
Copyright © 2006 Thomas P. Skinner1 Chapter 5 Indexers, Interfaces, and Enumerators.
FEN 2012 UCN Technology: Computer Science1 C# - Introduction Language Fundamentals in Brief.
Visual Studio 2005 Team System: Building Robust & Reliable Software Tejasvi Kumar Technology Specialist - VSTS Microsoft Corporation
Building Robust and Reliable Software Jason Anderson, Microsoft
DEV337 Modeling Distributed Enterprise Applications Using UML in Visual Studio.NET David Keogh Program Manager Visual Studio Enterprise Tools.
Visual C# 2005: IDE Enhancements Dan Fernandez C# Product Manager
Sudesh Krishnamoorthy Developer Technology Specialist | Microsoft |
DEV 301 Visual Studio Team System Tom Arnold Program Manager Microsoft Corporation “Enabling Better Software through Better Testing”
Joe Hummel, PhD Dept of Mathematics and Computer Science Lake Forest College
Introduction to VSTS Introduction to Visual Studio 2008 Development Edition Understanding code complexity using Code Metrics.
C# 2.0 and Future Directions Anders Hejlsberg Technical Fellow Microsoft Corporation.
[ISRAR ALI] Hammad Khan. The namespace keyword is used to declare a scope. Making software components reusable can result in naming collisions (two classes.
1 Visual Basic “Whidbey”: Advanced Language and IDE Features Steven Lees, Amanda Silver, Program Managers.
Advanced C# Types Tom Roeder CS fa. From last time out parameters difference is that the callee is required to assign it before returning not the.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Advanced.NET Programming I 10 th Lecture Pavel Ježek
Introduction to C# 2.0 An Advanced Look Adam Calderon Principal Engineer - Interknowlogy Microsoft MVP – C#
PROGRAMMING IN C#. Collection Classes (C# Programming Guide) The.NET Framework provides specialized classes for data storage and retrieval. These classes.
DEV311 Delving into Visual Studio 2005 Team Edition for Software Testers Ed Glas Group Manager, Web and Load Testing Microsoft Corporation.
Visual Studio 2005 C#VBC++J#WebExpress Visual Studio Standard Edition Visual Studio Professional Edition Novices Enthusiasts Students Hobbyists Part-Timers.
Visual Basic 2005: Advanced Language and IDE Features Amanda Silver Program Manager Visual Basic Session Code: DEV343.
WEB330 ASP.NET: Using Microsoft Visual 2005 Studio Team System to Build Enterprise Web Applications Brian Goldfarb Product Manager Web Platform and Tools.
Arrays Chapter 7.
Building Enterprise Applications Using Visual Studio®
Microsoft Visual Basic 2005: New Language Features
DotNetSpider Editor Hefin Dsouza
Advanced .NET Programming I 2nd Lecture
DEV260 Microsoft Visual Studio 2005 Team System: Managing the Software Lifecycle with Visual Studio 2005 Team System Bindia Hallauer Senior Product Manager.
Interfaces and Generics
Introduction to .NET Generics
Jim Fawcett CSE681 – Software Modeling and Analysis Fall 2005
Upgrading Your C# Programming Skills to Be a More Effective Developer
Iterators and Comparators
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
Customizing your device experience with assigned access
CS360 Windows Programming
Lecturer: Mukhtar Mohamed Ali “Hakaale”
Visual Studio 2005 “Personalized productivity”
.NET and .NET Core 9. Towards Higher Order Pan Wuming 2017.
Visual C# "Whidbey": Language Enhancements
Visual C# 2005: Language Enhancements
Tech Ed 2004 © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express.
DEV321 Visual C# 2005: Language Enhancements
DAT381 Team Development with SQL Server 2005
Jochen Seemann Program Manager Enterprise Tools Microsoft Corporation
Introduction to VSTS Database Professional
How to organize and document your classes
Advanced .NET Programming I 3rd Lecture
Windows Forms in Visual Studio 2005: An in-depth look at key features
Mark Quirk Head of Technology Developer & Platform Group
5. OOP OOP © 2003 Microsoft.
Visual C# 2005: Language Enhancements
Presentation transcript:

Getting Ready for Visual Studio 2005 London, October 19th 2005

So What’s New in Visual Studio ? Mike Pelton (Mike.Pelton@Microsoft.com) Mike Taulty (MTaulty@Microsoft.com) Developer and Platforms Group Microsoft Ltd

Housekeeping Launch Tour Caveats London, November 14th http://www.microsoft.com/uk/msdn Caveats We’re only scratching the surface These are brutally edited highlights Team System is a major topic in its own right

Agenda 18:30 Language and Framework Changes Mike<P> 19:00 IDE Enhancements Mike<T> 19:30 Break 20:00 What’s new in Windows Forms 20:30 What’s new in ASP.NET

Team System breaks down the barriers Developer Solution Architect Infrastructure Architect Tester Project Manager It’s not just about the developer anymore. Applications are so complex these days, that a single development project involves a number of different roles across the entire IT organization. BUILD Further, modern teams are: Geographically distributed More specialized than ever before Increased specialization leading to pockets of information More engagement of business people Shorter cycles to act Importance of the “abilities” Communication has never been more important End User

Visual Studio Team System Process and Architecture Guidance Visual Studio Industry Partners Visual Studio Team Architect Visual Studio Team Developer Visual Studio Team Test Application Designer Dynamic Code Analyzer Load Testing Logical Infra. Designer Static Code Analyzer Manual Testing Deployment Designer Code Profiler Test Case Management Unit Testing Code Coverage Class Designer Visio and UML Modeling Team Architect Highlight Team Foundation Client (includes CAL) Visual Studio Professional Edition Visual Studio Team Foundation Change Management Reporting Integration Services Big Build Work Item Tracking Project Site Project Management

Language Enhancements: An Introduction to Generics Demo Language Enhancements: An Introduction to Generics

Generics public class List { private object[] elements; private int count; public void Add(object element) { if (count == elements.Length) Resize(count * 2); elements[count++] = element; } public object this[int index] { get { return elements[index]; } set { elements[index] = value; } public int Count { get { return count; } public class List<T> { private T[] elements; private int count; public void Add(T element) { if (count == elements.Length) Resize(count * 2); elements[count++] = element; } public T this[int index] { get { return elements[index]; } set { elements[index] = value; } public int Count { get { return count; } List<int> intList = new List<int>(); intList.Add(1); // No boxing intList.Add(2); // No boxing intList.Add("Three"); // Compile-time error int i = intList[0]; // No cast required List intList = new List(); intList.Add(1); // Argument is boxed intList.Add(2); // Argument is boxed intList.Add("Three"); // Should be an error int i = (int)intList[0]; // Cast required List intList = new List(); intList.Add(1); intList.Add(2); intList.Add("Three"); int i = (int)intList[0];

Generics Public Class List Private elements() As Object Private mCount As Integer Public Sub Add(element As Object) If (mCount = elements.Length) Then _ Resize(mCount * 2) mCount += 1 elements(mCount) = element End Sub Default Public Property i(index As Integer) As Object Get Return elements(index) End Get Set elements(index) = value End Set End Property Public Property Count() As Integer Get : Return mCount : End Get End Class Public Class List(Of ItemType) Private elements() As ItemType Private count As Integer Public Sub Add(element As ItemType) If (count = elements.Length) Then _ Resize(count * 2) count += 1 elements(count) = element End Sub Public Property default(index As Integer) As ItemType Get : Return elements(index) : End Get Set : elements(index) = value : End Set End Property Public Property Count As Integer Get : Return count : End Get End Class Dim intList As New List(Of Integer) intList.Add(1) ‘ No boxing intList.Add(2) ‘ No boxing intList.Add("Three") ‘ Compile-time error int i = intList(0) ‘ No cast required Dim intList As New List intList.Add(1) intList.Add(2) intList.Add("Three") Dim i As Integer = intList(0) List intList = new List() intList.Add(1) ‘ Argument is boxed intList.Add(2) ‘ Argument is boxed intList.Add("Three") ‘ Should be an error int i = CInt(intList(0)) ‘ Cast required

Generics Why generics? How are C# generics implemented? Type checking, no boxing, no downcasts Reduced code bloat (typed collections) How are C# generics implemented? Instantiated at run-time, not compile-time Checked at declaration, not instantiation Work for both reference and value types Complete run-time type information

Generics Type parameters can be applied to Class, struct, interface, delegate types class Dictionary<K,V> {...} struct HashBucket<K,V> {...} interface IComparer<T> {...} delegate R Function<A,R>(A arg); Dictionary<string,Customer> customerLookupTable; Dictionary<string,List<Order>> orderLookupTable; Dictionary<string,int> wordCount;

Generics Type parameters can be applied to Class, struct, interface, delegate types Methods class Utils { public static T[] CreateArray<T>(int size) { return new T[size]; } public static void SortArray<T>(T[] array) { ... string[] names = Utils.CreateArray<string>(10); names[0] = "Jones"; ... Utils.SortArray(names);

Generics Type parameters can be applied to Class, struct, interface, delegate types Methods Type parameters can have constraints class Dictionary<K,V>: IDictionary<K,V> where K: IComparable<K> where V: IKeyProvider<K>, IPersistable, new() { public void Add(K key, V value) { ... } class Dictionary<K,V> { public void Add(K key, V value) { ... if (((IComparable)key).CompareTo(x) == 0) {...} } class Dictionary<K,V> where K: IComparable { public void Add(K key, V value) { ... if (key.CompareTo(x) == 0) {...} }

Generics Zero or one primary constraint Actual class, class, or struct Zero or more secondary constraints Interface or type parameter Zero or one constructor constraint new() class Link<T> where T: class {...} class Nullable<T> where T: struct {...} class Relation<T,U> where T: class where U: T {...}

Generics Collection classes Collection interfaces List<T> Dictionary<K,V> SortedDictionary<K,V> Stack<T> Queue<T> Collection classes Collection interfaces Collection base classes Utility classes Reflection IList<T> IDictionary<K,V> ICollection<T> IEnumerable<T> IEnumerator<T> IComparable<T> IComparer<T> Collection<T> KeyedCollection<T> ReadOnlyCollection<T> Nullable<T> EventHandler<T> Comparer<T>

With thanks to Kit George and GotDotNet Demo Generics Performance With thanks to Kit George and GotDotNet

Iterators foreach relies on “enumerator pattern” GetEnumerator() method foreach makes enumerating easy But enumerators are hard to write! foreach (object obj in list) { DoSomething(obj); } Enumerator e = list.GetEnumerator(); while (e.MoveNext()) { object obj = e.Current; DoSomething(obj); }

Iterators public class ListEnumerator : IEnumerator { List list; int index; internal ListEnumerator(List list) { this.list = list; index = -1; } public bool MoveNext() { int i = index + 1; if (i >= list.count) return false; index = i; return true; public object Current { get { return list.elements[index]; } public class List { internal object[] elements; internal int count; public IEnumerator GetEnumerator() { return new ListEnumerator(this); } public class List { internal object[] elements; internal int count; public IEnumerator GetEnumerator() { for (int i = 0; i < count; i++) { yield return elements[i]; }

public IEnumerator GetEnumerator() { return new __Enumerator(this); } private class __Enumerator : IEnumerator { object current; int state; public bool MoveNext() { switch (state) { case 0: current = "Hello"; state = 1; return true; case 1: current = "World"; state = 2; return true; default: return false; public object Current { get { return current; } Iterators Method that incrementally computes and returns a sequence of values yield return and yield break Must return IEnumerator or IEnumerable public class Test { public IEnumerator GetEnumerator() { yield return "Hello"; yield return "World"; }

Iterators public class List<T> { public IEnumerator<T> GetEnumerator() { for (int i = 0; i < count; i++) yield return elements[i]; } public IEnumerable<T> Descending() { for (int i = count - 1; i >= 0; i--) public IEnumerable<T> Subrange(int index, int n) { for (int i = 0; i < n; i++) yield return elements[index + i]; List<Item> items = GetItemList(); foreach (Item x in items) {...} foreach (Item x in items.Descending()) {...} foreach (Item x in Items.Subrange(10, 20)) {...}

Demo Iterators

Partial Types public partial class Customer { private int id; private string name; private string address; private List<Orders> orders; } public class Customer { private int id; private string name; private string address; private List<Orders> orders; public void SubmitOrder(Order order) { orders.Add(order); } public bool HasOutstandingOrders() { return orders.Count > 0; public partial class Customer { public void SubmitOrder(Order order) { orders.Add(order); } public bool HasOutstandingOrders() { return orders.Count > 0;

Partial Types in VB Single Type in Multiple Files Used to separate designer gen into another file Factor implementation Public Class Form1 Inherits Windows.Forms.Form ‘ Your Code End Class Partial Class Form1 ‘ Designer code Sub InitializeComponent() ‘ Your controls End Sub

Static Classes Only static members Cannot be used as type of variable, parameter, field, property, … Examples include System.Console, System.Environment public static class Math { public static double Sin(double x) {...} public static double Cos(double x) {...} ... }

Property Accessors Different accessor accessibility One accessor can be restricted further Typically set {…} more restricted public class Customer { private string id; public string CustomerId { get { return id; } internal set { id = value; } }

Accessor Accessibility Granular accessibility on Get and Set Forces calls to always use get, set Easy way to enforce validation Property Salary() As Integer Get Return mSalary End Get Private Set( value As Integer) If value < 0 Then Throw New Exception(“Mistake”) End If End Set End Property

And Relax…

With thanks to Joe Stegman for the sample code on WindowsForms.NET Demo Windows Forms 2.0 With thanks to Joe Stegman for the sample code on WindowsForms.NET

Data Binding and the New Grid Demo Data Binding and the New Grid With thanks to Michael Weinhardt’s MSDN “Wonders of Windows Forms” Column

“ClickOnce” Deployment Demo “ClickOnce” Deployment

And Relax…

© 2004 Microsoft Corporation. All rights reserved © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.