SlideShare une entreprise Scribd logo
1  sur  54
Visual Studio 2010 and the .NET 4.0 Framework Bart Wullems Application Architect Ordina Belgium
About me ,[object Object]
Application Architect
OrdinaBelgiumhttp://bartwullems.blogspot.com
ThingsI’ll cover Visual Studio 2010 Improvements .NET 4.0 Framework What’s New In C# 4.0 and Visual Basic 10
!Warning!High Geek Factor
This is an (almost) demo only presentation DEMO vs slides
Visual Studio 2010
What’schanged in Visual Studio 2010?
New Visual Studio 2010 Features… Generate From Usage HTML Snippets Breakpoint Grouping Parallel Tasks Window New Look & Feel Extensible Test Runner Dynamic Data Tooling Click-Once Enhancements for Office Highlight References WPF-based Editor Breakpoint Labeling MVC Tooling Call Hierarchy Improved WPF Tooling Sharepoint Tooling Historical Debugging Web Deploy Inline Call Tree Quick Search Concurrency Profiler Breakpoint Import/Export Document Map Margin 64-bit Mixed-Mode Parallel Stacks Window Minidump Debugging Improved Multi-Monitor JQueryIntellisense web.config Transformation
What’s changed in VS.NET? Full WPF IDE (including code editors) Multi-targeting Frameworks: 2.0, 3.0, 3.5, 4.0 General: F# development F# Explorer No dynamic help No object test bench Design Time: Call Hierarchy Explorer Generate from usage Live semantic errors Intellisense Completion vs. Suggestion Mode
What’s changed in VS.NET? (Cont.) Enhanced editors and project templates. ASP.NET WPF Silverlight  WYSIWYG Editors Entity Framework Architecture Modeling UML Editors Debugging Intellitrace
What’s changed in VS.NET? (Cont.) Extensibility Extension Manager MEF
Highlighting References CTRL+SHIFT+DOWN ARROW (forward) CTRL+SHIFT+UP ARROW (reverse)  Automatic highlighting of a symbol Can be used with declarations, references, and many other symbols
Navigate To CTRL + , Provides search-as-you-type support for symbols Enables quick searching based on case usage
Docking Windows New Guide Diamond Windows can be docked anywhere Can now pull document windows outside the IDE
Call Hierarchy (C# only) CTRL + K, T Used to see calls to and from a method Great way to see calls at design time
Zoom CTRL + Mouse Wheel New feature that enhances the size of your code Very useful for pair programming (or similar scenarios)
Generate from Usage Used to automatically create stub code Enables you to use classes and members before you define them
Intellisense Suggestion Mode CTRL + ALT + SPACE Used when classes and members are used before they are defined Helps to reduce situations where IntelliSense inserts unintended text into the editor
Breakpoints Can add labels to breakpoints All breakpoints are now searchable Import / Export now available
Floating Data Tips
Visual Studio 2010
.NET 4.0 Framework
Base Class Library Core types and services Common Language Runtime Assembly load and execution
Base Class Library Improvements Numerics BigInteger, Complex Data Structures Tuple SortedSet<T>, ISet<T> I/O Memory-Mapped File Unified Cancellation Model
.NET 4.0 New Runtime First new .NET runtime since 2.0 Side by Side Execution Functional Programming – F# Moving towards language parity – C#/VB Dynamic Language Runtime(DLR) Co- and Contra- Variance Code Contracts Parallel Computing
From There to Here… SP1 3.5 3.0 .NET 1.0 .NET 1.1 .NET 2.0 .NET 4 2002 2003 2010 2005-08 CLR 1.0 CLR 1.1 CLR 2.0 CLR 4
In-Process Side-By-Side (SxS) 2.0 add-in 3.0 add-in 3.5 add-in 4.0 add-in 3.5 .NET 4.0 3.0 .NET 2.0 Host Process (i.e. Outlook)
Functional Programming – F# F# is a functional programming language that runs on top of .NET Function is a first class citizen of a program General PurposeLanguage Important domains Scientific data analysis, data mining, domain-specificmodeling,… open System.IO openSystem.Collections.Generic letreadAllLines(file) = useinp = File.OpenText file     let res = new List<_>()     while not(inp.EndOfStream) do res.Add(inp.ReadLine()) res.ToArray()
What’s New InC# 4.0 and Visual Basic 10
Essence versus Ceremony Simple, Concise, Expressive
Ceremony in C# 3.0 Removing “magic values” via temporary variables GenerateChart(20, true); varprocessCount = 20; varcopyToWord = true; GenerateChart(processCount, copyToWord);
Ceremony in C# 3.0 Removing “magic values” via temporary variables GenerateChart(20, true); GenerateChart(20 /* processCount */,      true/* copyToWord */);
Ceremony in C# 3.0 Optional parameters via  method overloading voidGenerateChart(intprocessCount)  { GenerateChart(processCount, false);  } voidGenerateChart(intprocessCount, boolcopyToWord)  { // Do Something  }
C# Language Enhancements objectfileName = "Test.docx"; object missing  = System.Reflection.Missing.Value; doc.SaveAs(reffileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); Optional Params doc.SaveAs("Test.docx"); Named argument namedRange.Find("dog", xlByRows, MatchCase: True); Named arguments can appear in any order dynamic result = namedRange.Find(MatchCase: True, what: "dog", searchOrder: xlByRows); Late-binding through “dynamic” type Arguments evaluated in order written result.ClearContents();
Optional and Named Parameters publicStreamReaderOpenTextFile(     string path,     Encodingencoding, booldetectEncoding, intbufferSize); Primary method Secondary overloads publicStreamReaderOpenTextFile(     string path,     Encodingencoding, booldetectEncoding); publicStreamReaderOpenTextFile(     string path,     Encodingencoding); publicStreamReaderOpenTextFile(     string path); Call primary with default values
Optional and Named Parameters Optional parameters publicStreamReaderOpenTextFile(     string path,     Encodingencoding, booldetectEncoding, intbufferSize); publicStreamReaderOpenTextFile(     string path,     Encodingencoding = null, booldetectEncoding = true, intbufferSize = 1024); Named argument OpenTextFile("foo.txt", Encoding.UTF8); OpenTextFile("foo.txt", Encoding.UTF8, bufferSize: 4096); Arguments evaluated in order written Named arguments can appear in any order Named arguments must be last OpenTextFile( bufferSize: 4096,     path: "foo.txt", detectEncoding: false); Non-optional must be specified
C# 4.0
C# 4.0 Dynamic typing Covariance/Contravariance Named arguments Optional parameters COM interop enhancements DLR Support
Improved COM Interoperability
Ceremony in C# 3.0 Ugly COM Interop and the ever-present  “ref Missing.Value” var word = newWord.Application(); word.Documents.Add(ref Missing.Value,                     ref Missing.Value,                     ref Missing.Value,                     ref Missing.Value);
Improved COM Interoperability objectfileName = "Test.docx"; object missing  = System.Reflection.Missing.Value; doc.SaveAs(reffileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); doc.SaveAs("Test.docx");
Improved COM Interoperability Automatic object  dynamic mapping Optional and named parameters Indexed properties Optional “ref” modifier Interop type embedding (“No PIA”)
Improved COM Interoperability
Ceremony in VB 9 Backing fields for properties are explicit Privatem_nameAs String Public Property Name() As String Get Name = m_name End Get Set(ByValvalueAs String) m_name = value End  End Property
Ceremony in VB 9 Popularity of lambda-based libraries cause problems for VB developers SubMyMethod() LambdaCall(Function(i) TempMethod(i) End  Function) End Sub FunctionTempMethod(ByValparamasInteger) As Object Console.WriteLine(param) Return Nothing End Function Introduction of temporary functions “Hacks” since statement lambdas not supported
Ceremony in VB 9 Line continuations must be specified by the developer SomeLongMethodCall(firstParam, _ secondParam, _ thirdParam, _ fourthParam, _ fifthParam)
Ceremony in VB 9 Creating collections takes a lot of code Dimnames = NewList(Of String) names.Add("Jason") names.Add("Drew") names.Add("Jonathan")
VB.NET 10
VB.NET 10 Auto-Implemented Properties Collection Initializers Implicit Line Continuation Multiline Lambda Support DLR Support Covariance/Contravariance

Contenu connexe

Tendances

C# / Java Language Comparison
C# / Java Language ComparisonC# / Java Language Comparison
C# / Java Language ComparisonRobert Bachmann
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftTalentica Software
 
Java 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & StreamsJava 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & StreamsNewCircle Training
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
.Net passé, présent et futur
.Net passé, présent et futur.Net passé, présent et futur
.Net passé, présent et futurDenis Voituron
 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionEelco Visser
 
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...lennartkats
 
Rest style web services (google protocol buffers) prasad nirantar
Rest style web services (google protocol buffers)   prasad nirantarRest style web services (google protocol buffers)   prasad nirantar
Rest style web services (google protocol buffers) prasad nirantarIndicThreads
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentationVan Huong
 
Android coding guide lines
Android coding guide linesAndroid coding guide lines
Android coding guide lineslokeshG38
 
Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)jeffz
 

Tendances (20)

Java8
Java8Java8
Java8
 
Deep C
Deep CDeep C
Deep C
 
C# / Java Language Comparison
C# / Java Language ComparisonC# / Java Language Comparison
C# / Java Language Comparison
 
Building scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thriftBuilding scalable and language independent java services using apache thrift
Building scalable and language independent java services using apache thrift
 
Java 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & StreamsJava 8 Lambda Expressions & Streams
Java 8 Lambda Expressions & Streams
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Linq intro
Linq introLinq intro
Linq intro
 
.Net passé, présent et futur
.Net passé, présent et futur.Net passé, présent et futur
.Net passé, présent et futur
 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: Introduction
 
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
Mixing Source and Bytecode: A Case for Compilation By Normalization (OOPSLA 2...
 
JAVA BASICS
JAVA BASICSJAVA BASICS
JAVA BASICS
 
Rest style web services (google protocol buffers) prasad nirantar
Rest style web services (google protocol buffers)   prasad nirantarRest style web services (google protocol buffers)   prasad nirantar
Rest style web services (google protocol buffers) prasad nirantar
 
Streams in Java 8
Streams in Java 8Streams in Java 8
Streams in Java 8
 
Java 8 presentation
Java 8 presentationJava 8 presentation
Java 8 presentation
 
Android coding guide lines
Android coding guide linesAndroid coding guide lines
Android coding guide lines
 
What's New in Visual Studio 2008
What's New in Visual Studio 2008What's New in Visual Studio 2008
What's New in Visual Studio 2008
 
Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)Why Java Sucks and C# Rocks (Final)
Why Java Sucks and C# Rocks (Final)
 
Java 8 Lambda and Streams
Java 8 Lambda and StreamsJava 8 Lambda and Streams
Java 8 Lambda and Streams
 
C# in depth
C# in depthC# in depth
C# in depth
 
Chapter 2 c#
Chapter 2 c#Chapter 2 c#
Chapter 2 c#
 

En vedette

Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net frameworkArun Prasad
 
Dotnet Frameworks Version History
Dotnet Frameworks Version HistoryDotnet Frameworks Version History
Dotnet Frameworks Version Historyvoltaincx
 
Part 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative valuePart 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative valueGirija Muscut
 
Part 1 picturebox using vb.net
Part 1 picturebox using vb.netPart 1 picturebox using vb.net
Part 1 picturebox using vb.netGirija Muscut
 
How Not To Be Seen
How Not To Be SeenHow Not To Be Seen
How Not To Be SeenMark Pesce
 
Part 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.netPart 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.netGirija Muscut
 
Cognitive information science
Cognitive information scienceCognitive information science
Cognitive information scienceS. Kate Devitt
 
Logical Programming With ruby-prolog
Logical Programming With ruby-prologLogical Programming With ruby-prolog
Logical Programming With ruby-prologPreston Lee
 
Making Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information DesignMaking Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information DesignHubbard One
 
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-uPython Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-uNikola Plejic
 
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert HenrichsPioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert HenrichsWolfgang Stock
 
What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++Microsoft
 
Part 3 binding navigator vb.net
Part 3 binding navigator vb.netPart 3 binding navigator vb.net
Part 3 binding navigator vb.netGirija Muscut
 
Debugging in visual studio (basic level)
Debugging in visual studio (basic level)Debugging in visual studio (basic level)
Debugging in visual studio (basic level)Larry Nung
 
Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3a_akhavan
 
Transforming the world with Information technology
Transforming the world with Information technologyTransforming the world with Information technology
Transforming the world with Information technologyGlenn Klith Andersen
 
Part2 database connection service based using vb.net
Part2 database connection service based using vb.netPart2 database connection service based using vb.net
Part2 database connection service based using vb.netGirija Muscut
 

En vedette (20)

Introduction to .net framework
Introduction to .net frameworkIntroduction to .net framework
Introduction to .net framework
 
C# 3.5 Features
C# 3.5 FeaturesC# 3.5 Features
C# 3.5 Features
 
Dotnet Frameworks Version History
Dotnet Frameworks Version HistoryDotnet Frameworks Version History
Dotnet Frameworks Version History
 
Part 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative valuePart 5 create sequence increment value using negative value
Part 5 create sequence increment value using negative value
 
Part 1 picturebox using vb.net
Part 1 picturebox using vb.netPart 1 picturebox using vb.net
Part 1 picturebox using vb.net
 
How Not To Be Seen
How Not To Be SeenHow Not To Be Seen
How Not To Be Seen
 
Presentation1
Presentation1Presentation1
Presentation1
 
Part 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.netPart 8 add,update,delete records using records operation buttons in vb.net
Part 8 add,update,delete records using records operation buttons in vb.net
 
Cognitive information science
Cognitive information scienceCognitive information science
Cognitive information science
 
Logical Programming With ruby-prolog
Logical Programming With ruby-prologLogical Programming With ruby-prolog
Logical Programming With ruby-prolog
 
Introduction to XML
Introduction to XMLIntroduction to XML
Introduction to XML
 
Making Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information DesignMaking Information Usable: The Art & Science of Information Design
Making Information Usable: The Art & Science of Information Design
 
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-uPython Tools for Visual Studio: Python na Microsoftovom .NET-u
Python Tools for Visual Studio: Python na Microsoftovom .NET-u
 
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert HenrichsPioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
Pioneers of Information Science in Europe: The Oeuvre of Norbert Henrichs
 
What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++What&rsquo;s new in Visual C++
What&rsquo;s new in Visual C++
 
Part 3 binding navigator vb.net
Part 3 binding navigator vb.netPart 3 binding navigator vb.net
Part 3 binding navigator vb.net
 
Debugging in visual studio (basic level)
Debugging in visual studio (basic level)Debugging in visual studio (basic level)
Debugging in visual studio (basic level)
 
Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3Prolog -Cpt114 - Week3
Prolog -Cpt114 - Week3
 
Transforming the world with Information technology
Transforming the world with Information technologyTransforming the world with Information technology
Transforming the world with Information technology
 
Part2 database connection service based using vb.net
Part2 database connection service based using vb.netPart2 database connection service based using vb.net
Part2 database connection service based using vb.net
 

Similaire à Visual Studio 2010 and .NET 4.0 Overview

MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersDave Bost
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 
Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Bruce Johnson
 
.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep Joshi.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep JoshiSpiffy
 
What’s New and Hot in .NET 4.0
What’s New and Hot in .NET 4.0What’s New and Hot in .NET 4.0
What’s New and Hot in .NET 4.0Jess Chadwick
 
A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010Abram John Limpin
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NETsalonityagi
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0Thomas Conté
 
Code Generation using T4
Code Generation using T4Code Generation using T4
Code Generation using T4Joubin Najmaie
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLsintelliyole
 
PDC Video on C# 4.0 Futures
PDC Video on C# 4.0 FuturesPDC Video on C# 4.0 Futures
PDC Video on C# 4.0 Futuresnithinmohantk
 

Similaire à Visual Studio 2010 and .NET 4.0 Overview (20)

MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0Overview of VS2010 and .NET 4.0
Overview of VS2010 and .NET 4.0
 
.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep Joshi.NET 4 Demystified - Sandeep Joshi
.NET 4 Demystified - Sandeep Joshi
 
What’s New and Hot in .NET 4.0
What’s New and Hot in .NET 4.0What’s New and Hot in .NET 4.0
What’s New and Hot in .NET 4.0
 
A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010A Lap Around Visual Studio 2010
A Lap Around Visual Studio 2010
 
Visual Studio.NET
Visual Studio.NETVisual Studio.NET
Visual Studio.NET
 
Visual studio.net
Visual studio.netVisual studio.net
Visual studio.net
 
C# tutorial
C# tutorialC# tutorial
C# tutorial
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
T4 presentation
T4 presentationT4 presentation
T4 presentation
 
Code Generation using T4
Code Generation using T4Code Generation using T4
Code Generation using T4
 
Vb essentials
Vb essentialsVb essentials
Vb essentials
 
Introduction to Visual Studio.NET
Introduction to Visual Studio.NETIntroduction to Visual Studio.NET
Introduction to Visual Studio.NET
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Intro dotnet
Intro dotnetIntro dotnet
Intro dotnet
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
 
PDC Video on C# 4.0 Futures
PDC Video on C# 4.0 FuturesPDC Video on C# 4.0 Futures
PDC Video on C# 4.0 Futures
 

Plus de bwullems

GraphQL - A love story
GraphQL -  A love storyGraphQL -  A love story
GraphQL - A love storybwullems
 
ElasticSearch - Search done right
ElasticSearch - Search done rightElasticSearch - Search done right
ElasticSearch - Search done rightbwullems
 
Techorama - Evolvable Application Development with MongoDB
Techorama  - Evolvable Application Development with MongoDBTechorama  - Evolvable Application Development with MongoDB
Techorama - Evolvable Application Development with MongoDBbwullems
 
Git(hub) for windows developers
Git(hub) for windows developersGit(hub) for windows developers
Git(hub) for windows developersbwullems
 
Javascript omg!
Javascript omg!Javascript omg!
Javascript omg!bwullems
 
Tfs Monitor Windows Phone 7 App
Tfs Monitor Windows Phone 7 AppTfs Monitor Windows Phone 7 App
Tfs Monitor Windows Phone 7 Appbwullems
 
Caliburn.micro
Caliburn.microCaliburn.micro
Caliburn.microbwullems
 
Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernatebwullems
 
Convention over configuration in .Net 4.0
Convention over configuration in .Net 4.0Convention over configuration in .Net 4.0
Convention over configuration in .Net 4.0bwullems
 

Plus de bwullems (9)

GraphQL - A love story
GraphQL -  A love storyGraphQL -  A love story
GraphQL - A love story
 
ElasticSearch - Search done right
ElasticSearch - Search done rightElasticSearch - Search done right
ElasticSearch - Search done right
 
Techorama - Evolvable Application Development with MongoDB
Techorama  - Evolvable Application Development with MongoDBTechorama  - Evolvable Application Development with MongoDB
Techorama - Evolvable Application Development with MongoDB
 
Git(hub) for windows developers
Git(hub) for windows developersGit(hub) for windows developers
Git(hub) for windows developers
 
Javascript omg!
Javascript omg!Javascript omg!
Javascript omg!
 
Tfs Monitor Windows Phone 7 App
Tfs Monitor Windows Phone 7 AppTfs Monitor Windows Phone 7 App
Tfs Monitor Windows Phone 7 App
 
Caliburn.micro
Caliburn.microCaliburn.micro
Caliburn.micro
 
Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernate
 
Convention over configuration in .Net 4.0
Convention over configuration in .Net 4.0Convention over configuration in .Net 4.0
Convention over configuration in .Net 4.0
 

Dernier

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Dernier (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Visual Studio 2010 and .NET 4.0 Overview

  • 1. Visual Studio 2010 and the .NET 4.0 Framework Bart Wullems Application Architect Ordina Belgium
  • 2.
  • 5. ThingsI’ll cover Visual Studio 2010 Improvements .NET 4.0 Framework What’s New In C# 4.0 and Visual Basic 10
  • 7.
  • 8. This is an (almost) demo only presentation DEMO vs slides
  • 9.
  • 12. New Visual Studio 2010 Features… Generate From Usage HTML Snippets Breakpoint Grouping Parallel Tasks Window New Look & Feel Extensible Test Runner Dynamic Data Tooling Click-Once Enhancements for Office Highlight References WPF-based Editor Breakpoint Labeling MVC Tooling Call Hierarchy Improved WPF Tooling Sharepoint Tooling Historical Debugging Web Deploy Inline Call Tree Quick Search Concurrency Profiler Breakpoint Import/Export Document Map Margin 64-bit Mixed-Mode Parallel Stacks Window Minidump Debugging Improved Multi-Monitor JQueryIntellisense web.config Transformation
  • 13. What’s changed in VS.NET? Full WPF IDE (including code editors) Multi-targeting Frameworks: 2.0, 3.0, 3.5, 4.0 General: F# development F# Explorer No dynamic help No object test bench Design Time: Call Hierarchy Explorer Generate from usage Live semantic errors Intellisense Completion vs. Suggestion Mode
  • 14. What’s changed in VS.NET? (Cont.) Enhanced editors and project templates. ASP.NET WPF Silverlight WYSIWYG Editors Entity Framework Architecture Modeling UML Editors Debugging Intellitrace
  • 15. What’s changed in VS.NET? (Cont.) Extensibility Extension Manager MEF
  • 16. Highlighting References CTRL+SHIFT+DOWN ARROW (forward) CTRL+SHIFT+UP ARROW (reverse) Automatic highlighting of a symbol Can be used with declarations, references, and many other symbols
  • 17. Navigate To CTRL + , Provides search-as-you-type support for symbols Enables quick searching based on case usage
  • 18. Docking Windows New Guide Diamond Windows can be docked anywhere Can now pull document windows outside the IDE
  • 19. Call Hierarchy (C# only) CTRL + K, T Used to see calls to and from a method Great way to see calls at design time
  • 20. Zoom CTRL + Mouse Wheel New feature that enhances the size of your code Very useful for pair programming (or similar scenarios)
  • 21. Generate from Usage Used to automatically create stub code Enables you to use classes and members before you define them
  • 22. Intellisense Suggestion Mode CTRL + ALT + SPACE Used when classes and members are used before they are defined Helps to reduce situations where IntelliSense inserts unintended text into the editor
  • 23. Breakpoints Can add labels to breakpoints All breakpoints are now searchable Import / Export now available
  • 25.
  • 28. Base Class Library Core types and services Common Language Runtime Assembly load and execution
  • 29. Base Class Library Improvements Numerics BigInteger, Complex Data Structures Tuple SortedSet<T>, ISet<T> I/O Memory-Mapped File Unified Cancellation Model
  • 30. .NET 4.0 New Runtime First new .NET runtime since 2.0 Side by Side Execution Functional Programming – F# Moving towards language parity – C#/VB Dynamic Language Runtime(DLR) Co- and Contra- Variance Code Contracts Parallel Computing
  • 31. From There to Here… SP1 3.5 3.0 .NET 1.0 .NET 1.1 .NET 2.0 .NET 4 2002 2003 2010 2005-08 CLR 1.0 CLR 1.1 CLR 2.0 CLR 4
  • 32. In-Process Side-By-Side (SxS) 2.0 add-in 3.0 add-in 3.5 add-in 4.0 add-in 3.5 .NET 4.0 3.0 .NET 2.0 Host Process (i.e. Outlook)
  • 33. Functional Programming – F# F# is a functional programming language that runs on top of .NET Function is a first class citizen of a program General PurposeLanguage Important domains Scientific data analysis, data mining, domain-specificmodeling,… open System.IO openSystem.Collections.Generic letreadAllLines(file) = useinp = File.OpenText file let res = new List<_>() while not(inp.EndOfStream) do res.Add(inp.ReadLine()) res.ToArray()
  • 34. What’s New InC# 4.0 and Visual Basic 10
  • 35. Essence versus Ceremony Simple, Concise, Expressive
  • 36. Ceremony in C# 3.0 Removing “magic values” via temporary variables GenerateChart(20, true); varprocessCount = 20; varcopyToWord = true; GenerateChart(processCount, copyToWord);
  • 37. Ceremony in C# 3.0 Removing “magic values” via temporary variables GenerateChart(20, true); GenerateChart(20 /* processCount */, true/* copyToWord */);
  • 38. Ceremony in C# 3.0 Optional parameters via method overloading voidGenerateChart(intprocessCount) { GenerateChart(processCount, false); } voidGenerateChart(intprocessCount, boolcopyToWord) { // Do Something }
  • 39. C# Language Enhancements objectfileName = "Test.docx"; object missing = System.Reflection.Missing.Value; doc.SaveAs(reffileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); Optional Params doc.SaveAs("Test.docx"); Named argument namedRange.Find("dog", xlByRows, MatchCase: True); Named arguments can appear in any order dynamic result = namedRange.Find(MatchCase: True, what: "dog", searchOrder: xlByRows); Late-binding through “dynamic” type Arguments evaluated in order written result.ClearContents();
  • 40. Optional and Named Parameters publicStreamReaderOpenTextFile( string path, Encodingencoding, booldetectEncoding, intbufferSize); Primary method Secondary overloads publicStreamReaderOpenTextFile( string path, Encodingencoding, booldetectEncoding); publicStreamReaderOpenTextFile( string path, Encodingencoding); publicStreamReaderOpenTextFile( string path); Call primary with default values
  • 41. Optional and Named Parameters Optional parameters publicStreamReaderOpenTextFile( string path, Encodingencoding, booldetectEncoding, intbufferSize); publicStreamReaderOpenTextFile( string path, Encodingencoding = null, booldetectEncoding = true, intbufferSize = 1024); Named argument OpenTextFile("foo.txt", Encoding.UTF8); OpenTextFile("foo.txt", Encoding.UTF8, bufferSize: 4096); Arguments evaluated in order written Named arguments can appear in any order Named arguments must be last OpenTextFile( bufferSize: 4096, path: "foo.txt", detectEncoding: false); Non-optional must be specified
  • 43. C# 4.0 Dynamic typing Covariance/Contravariance Named arguments Optional parameters COM interop enhancements DLR Support
  • 45. Ceremony in C# 3.0 Ugly COM Interop and the ever-present “ref Missing.Value” var word = newWord.Application(); word.Documents.Add(ref Missing.Value, ref Missing.Value, ref Missing.Value, ref Missing.Value);
  • 46. Improved COM Interoperability objectfileName = "Test.docx"; object missing = System.Reflection.Missing.Value; doc.SaveAs(reffileName, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); doc.SaveAs("Test.docx");
  • 47. Improved COM Interoperability Automatic object  dynamic mapping Optional and named parameters Indexed properties Optional “ref” modifier Interop type embedding (“No PIA”)
  • 49. Ceremony in VB 9 Backing fields for properties are explicit Privatem_nameAs String Public Property Name() As String Get Name = m_name End Get Set(ByValvalueAs String) m_name = value End End Property
  • 50. Ceremony in VB 9 Popularity of lambda-based libraries cause problems for VB developers SubMyMethod() LambdaCall(Function(i) TempMethod(i) End Function) End Sub FunctionTempMethod(ByValparamasInteger) As Object Console.WriteLine(param) Return Nothing End Function Introduction of temporary functions “Hacks” since statement lambdas not supported
  • 51. Ceremony in VB 9 Line continuations must be specified by the developer SomeLongMethodCall(firstParam, _ secondParam, _ thirdParam, _ fourthParam, _ fifthParam)
  • 52. Ceremony in VB 9 Creating collections takes a lot of code Dimnames = NewList(Of String) names.Add("Jason") names.Add("Drew") names.Add("Jonathan")
  • 54. VB.NET 10 Auto-Implemented Properties Collection Initializers Implicit Line Continuation Multiline Lambda Support DLR Support Covariance/Contravariance
  • 55. DLR
  • 56. .NET Dynamic Programming IronPython IronRuby C# VB.NET Others… Dynamic Language Runtime Expression Trees Dynamic Dispatch Call Site Caching PythonBinder RubyBinder COMBinder JavaScriptBinder ObjectBinder
  • 57. Dynamically-Typed Ruby Python Statically-Typed VB C# Common Language Runtime Why the DLR?
  • 58. Dynamically-Typed Ruby Python Statically-Typed VB Dynamic Language Runtime C# Common Language Runtime Why the DLR?
  • 59. Ceremony in C# 3.0 Dynamic Language interop is painful Calculator calc = GetCalculator(); int sum = calc.Add(10, 20);
  • 60. Ceremony in C# 3.0 Dynamic Language interop is painful object calc = GetCalculator(); TypecalcType = calc.GetType(); object res = calcType.InvokeMember("Add", BindingFlags.InvokeMethod, null, new object[] { 10, 20 }); int sum = Convert.ToInt32(res);
  • 61. Ceremony in C# 3.0 Dynamic Language interop is painful ScriptObject calc = GetCalculator(); object res = calc.Invoke("Add", 10, 20); int sum = Convert.ToInt32(res);
  • 62. Essence in C# 4.0 Dynamic Language interop doesn’t have to be painful! Statically typed to be dynamic dynamic calc = GetCalculator(); int sum = calc.Add(10, 20); Dynamic method invocation Dynamic conversion
  • 63. Dynamically Typed Objects Calculator calc = GetCalculator(); int sum = calc.Add(10, 20); object calc = GetCalculator(); TypecalcType = calc.GetType(); object res = calcType.InvokeMember("Add", BindingFlags.InvokeMethod, null, newobject[] { 10, 20 }); int sum = Convert.ToInt32(res); ScriptObject calc = GetCalculator(); object res = calc.Invoke("Add", 10, 20); int sum = Convert.ToInt32(res); Statically typed to be dynamic dynamic calc = GetCalculator(); int sum = calc.Add(10, 20); Dynamic method invocation Dynamic conversion
  • 64.
  • 65. At run-time, actual type(s) substituted for dynamic
  • 66.
  • 67. Dynamic Language Runtime Provides a common implementation and interoperation substrate for dynamic languages, similar to what the Common Language Runtime and Common Type System provide for statically typed languages Developed for IronPython and IronRuby Included in .NET 4.0 as part of the runtime and type system (e.g. C# 4 knows about the DLR IDynamicObject convention)
  • 68. DLR
  • 71. Co- and Contra-variance .NET arrays are co-variant string[] strings = GetStringArray(); Process(strings); …but not safelyco-variant void Process(object[] objects){ … } void Process(object[] objects) { objects[0] = "Hello"; // Ok objects[1] = newButton(); // Exception! } Until now, C# generics have been invariant List<string> strings = GetStringList(); Process(strings); C# 4.0 supports safe co- and contra-variance void Process(IEnumerable<object> objects) { // IEnumerable<T> is read-only and // therefore safely co-variant } void Process(IEnumerable<object> objects) { … }
  • 72. Safe Co- and Contra-variance publicinterfaceIEnumerable<out T> { IEnumerator<T> GetEnumerator(); } out= Co-variantOutput positions only Can be treated asless derived publicinterfaceIEnumerator<out T> { T Current { get; } boolMoveNext(); } IEnumerable<string> strings = GetStrings(); IEnumerable<object> objects = strings; in= Contra-variantInput positions only publicinterfaceIComparer<in T> { int Compare(T x, T y); } Can be treated asmore derived IComparer<object> objComp = GetComparer(); IComparer<string> strComp = objComp;
  • 73. Generic co- and contravariance If T appears only as an output, it’s safe to passX<TDerived> for X<T> We call this covariance If T appears only as an input, it’s safe to passX<TBase> for X<T> We call this contravariance
  • 74. Fixing The Type System… Covariance and Contravariance… sounds complicated… But it’s not! sort of…
  • 75. Fixing The Type System… How are generic types “broken” today? class Animal { } class Sheep : Animal { } void Speak(IEnumerable<Animal> animals) { // Do something with Animals } Not Allowed: IEnumerable<Animal> != IEnumerable<Sheep> var sheep = new List<Sheep>(); Speak(sheep);
  • 76. Break it down… Covariance – think “out” Contravariance – think “in”
  • 78. Why Contracts? Just because something compiles, doesn’t mean it works…
  • 79. Design By Contract Code Contracts introduce a way to specify contractual information that is not represented by a method or type’s signature alone.
  • 80. Code Contracts What does it expect? (Preconditions) Contract.Requires() What does it guarantee? (Postconditions) Contract.Ensures() What does it maintain? (Invariants) Contract.Invariant()
  • 81. A Contract contains… Pre-conditions - must be true before public Rational(int numerator, int denominator) { Contract.Requires(denominator > 0); … } Post-conditions - must be true after public string GetPassword() { Contract.Ensures(Contract.Result<string>() != null); … return password; }
  • 82. A Contract contains… Invariants - must always be true [ContractInvariantMethod] protectedvoidObjectInvariant() { Contract.Invariant(denominator > 0); }
  • 83. Let’s Fix It For Once And All! Design-by-Contract meets .NET! stringGetDescription(intx) { Contract.Requires( 0 < x ); Contract.Ensures(Contract.Result<string>()!=null); … }
  • 86.
  • 87. The Parallel Computing Initiative Letting the brightest developers solve business problems, not concurrency problems.
  • 88.
  • 89. Parallel Computing with .NET 4 Task Parallel Library (TPL) Parallel LINQ (PLINQ) Coordination Data Structures (CDS) System.Threading Improvements
  • 90. Task-based Programming ThreadPool ThreadPool.QueueUserWorkItem(…); System.Threading.Tasks Starting Parent/Child Continue/Wait/Cancel Task.Factory.StartNew(…); var p = newTask(() => { vart = newTask(…);}); Taskt = … Taskp = t.ContinueWith(…); t.Wait(2000); t.Cancel(); Taskswith results Task<int> f = newTask<int>(() => C()); … int result = f.Result;
  • 91.
  • 93. System.Threading.Tasks// Sequential foreach (var item in sourceCollection) { Process(item); } // Parallel Parallel.ForEach (sourceCollection, item => Process(item));
  • 94.
  • 95. Extension methods for the IParallelEnumerable interface
  • 96. Additional operators for parallel operationsfrom n in names.AsParallel().WithDegreeOfParallelism(ProcessorsToUse.Value) where n.Name.Equals(queryInfo.Name, StringComparison.InvariantCultureIgnoreCase) && n.State == queryInfo.State && n.Year >= yearStart && n.Year <= yearEnd orderbyn.Year ascending select n;
  • 97. Declarative Data Parallelism Parallel LINQ-to-Objects (PLINQ) Built on top of Tasks Enables LINQ devs to leverage multiple cores Fully supports all .NET standard query operators Minimal impact to existing LINQ model var q = from p in people         wherep.Name == queryInfo.Name && p.State == queryInfo.State && p.Year >= yearStart && p.Year <= yearEnd         orderbyp.Yearascending         select p; .AsParallel()
  • 98. Structured Parallelism Parallel class static (overloaded) methods helper methods to create/work with Tasks encapsulates common patterns
  • 100. The Problem… Software Maintenance Original Software Development
  • 101. Managed Extensibility Framework? The Managed Extensibility Framework (MEF) is a new libraryin 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
  • 102. MEF Basics… Export it. Import it. Compose it.
  • 103. Part, enter stage left… public class SimpleMortgageCalculator : IMortgageCalculator { publicILogger Logger { get; set; } publicfloat Calculate() { Logger.Log("Calculating Mortgage"); return ...; } } Part A
  • 104. Exportit… [Export(typeof(IMortgageCalculator))] public class SimpleMortgageCalculator : IMortgageCalculator { publicILogger Logger { get; set; } publicfloat Calculate() { Logger.Log("Calculating Mortgage"); return ...; } } Part A
  • 105. Importit… [Export(typeof(IMortgageCalculator))] public class SimpleMortgageCalculator : IMortgageCalculator { [Import(typeof(ILogger))] publicILogger Logger { get; set; } publicfloat Calculate() { Logger.Log("Calculating Mortgage"); return ...; } } Part A
  • 106. Compose it. Catalogs provide the parts. Catalog
  • 107. Compose it. Containeris the matchmaker. Catalog
  • 108. Compose it. AggregatingCatalog Containeris the matchmaker. DirectoryCatalog AssemblyCatalog Catalog TypeCatalog
  • 109. MEF
  • 111. Conclusion Visual Studio 2010 and .NET 4.0 is a major release Essence vsCeremony Generic types are no longer “broken” Design by Contract Parallel Developmentbecomes easy

Notes de l'éditeur

  1. About me
  2. One of the coolest new features that you don’t have to do anything to get: Reference Highlighting. When you click on a symbol (variable name, method name, etc…) the IDE will automatically highlight all the references to that symbol.The best part is you can navigate between the highlighted references! NOTE: For demo info, go here-&gt; http://blogs.msdn.com/zainnab/archive/2010/01/18/how-to-use-reference-highlighting.aspx
  3. Menu: Edit -&gt; Navigate ToThe new Navigate To dialog allows you to search for symbols by narrowing the search as you type. But it doesn’t stop there! If you use Pascal Case for your symbols then you can use just the upper-case letters to search.NOTE: For demo info, go here-&gt; http://blogs.msdn.com/zainnab/archive/2010/01/20/how-to-use-navigate-to-vstiptool0006.aspx
  4. The docking guides are very much improved over the previous experience with an updated Guide Diamond. But that’s not the best part…You can NOW FINALLY pull document windows out of the IDE! NOTE: This demo is very straightforward simply dock and undock windows then pull a document tab out of the IDE.
  5. For the C# folks this is one heck of a great tool: Call Hierarchy. It allows you to &quot;visualize all calls to and from a selected method, property, or constructor&quot;. To see how it works just right-click on any method, property, or constructor in the Editor and select View Call Hierarchy.It not only allows you to visualize calls To and From but you can Go to references, copy code, and even rearrange the view in the hierarchy.NOTE: Normally you can just stick to right-clicking a method in C# and choosing NOTE: For demo info, go here-&gt; http://blogs.msdn.com/zainnab/archive/2010/01/19/using-the-call-hierarchy-c-only-vstiptool0005.aspx
  6. This is the first of the set of enhancements for agile programming. In pair programing scenarios, you often have two people looking at one set of code at the same time. When you want to focus in on a set of code to make it easier to read you can now just use CTRL + Mouse Wheel to zoom your text.NOTE: This demo is very simple just show zooming behavior. Pair programming is the reason given here but this is also very useful for just making code easier to read when you need it.
  7. The idea behind this feature is simple, it allows you to use classes and members before you define them.  Why would you want to do that? Well, Test Driven Development folks like to use classes and members before we create them. There are a lot of reasons for this we won’t go into here but this is an awesome new feature for TDD.NOTE: For demo info, go here-&gt; http://blogs.msdn.com/zainnab/archive/2010/01/21/using-generate-from-usage-vstipedit0011.aspx
  8. In the last demo you may have noticed that Intellisense kicked in. This can be annoying sometimes if you accidentally use one of its suggestions instead of what you meant to type. For this situation we now have Suggestion Mode. By hitting CTRL + ALT + SPACE or going to Edit -&gt; Intellisense -&gt; Toggle Completion Mode. By using this option you can avoid getting unwanted choices.NOTE: This is an easy demo just use the keyboard shortcut or menu option to enable Suggestion Mode. The hardest part here is getting people to understand why they would want to use it. Agile developers will mostly get it while most others will not so be prepared to have offline discussions for those interested.For demo info, go here-&gt; http://blogs.msdn.com/zainnab/archive/2010/01/22/intellisense-suggestion-mode-vstipedit0012.aspx
  9. Breakpoints have undergone some MAJOR improvements to make your life easier. Most notably you can now add labels, search breakpoints, and even do import/export tasks.NOTE: For demo info, go here-&gt; Labels: http://blogs.msdn.com/zainnab/archive/2010/01/26/adding-labels-to-breakpoints-vstipdebug0001.aspxSearching (avail 1/27): http://blogs.msdn.com/zainnab/archive/2010/01/27/searching-breakpoints-vstipdebug0002.aspxImport/Export (avail 1/28): http://blogs.msdn.com/zainnab/archive/2010/01/28/how-to-import-and-export-breakpoints-vstipdebug0003.aspx
  10. DataTips are now like a Super Quick Watch. They can be pinned to source, have comments, and tell you values.NOTE: See the demo doc (Pin a DataTip to source.docx) for a sample demo.
  11. WPF BasedEditorCode Editing &amp; Navigation(QuickSearch, CallHierarchy, …)IntellisensesuggestionvscompletionExtension ManagerBreakpoints and labels SuperQuickwatchDebug export and import datatipsCleanupweb.configJqueryintegrationJqueryIntelisenseHtml snippetsGeneratedependencygraph Beginnen met VS2010TrainingKit demo
  12. Before we get started, I thought it would be a good idea to review where we have come from:In the past we have delivered monolithic releases. You saw this with .NET versions 1.0 and 1.1 before. When .NET 2.0 shipped we decided to make a “layer cake” of improvements where we added on 3.0, 3.5, and finally 3.5 service pack 1. There were a number of reasons for doing this but chief among them was to make sure you didn’t have to completely retest the CLR every time we incremented it. We did this for about 5 years.You can only keep that system up for so long, however, and 4.0 represents some pretty significant changes and updates to the Framework and the CLR. Because of this we decided to make it stand on its own and have incremented the CLR version accordingly. As such, it will probably have to undergo the testing your security teams have in place and we want to set expectations accordingly. NOTE: This is to make sure folks know the bad news up front. We will use the rest of the session to deliver the good news. Here is where you can find the history of .NET Framework versions: http://en.wikipedia.org/wiki/.NET_Framework_version_list
  13. Optional and named parameters
  14. Optional and named parametersDEMO:Shows how the combination of named and optional parameters combine to allow a developer to write simpler code or to simplify existing code. Use One.SimplifyYourCSharpCode from the LanguagesTenInOne solution.FAQ:[Q] Are optional parameters a compiler feature, or a runtime feature?[A] It is a compiler feature. The value of the optional parameter is compiled into the callsite at compile time. This means that if the value of the optional parameters is changed at a later date and the code isn’t recompiled, you could have code that doesn’t work as you expected and could introduce subtle bugs
  15. Tonen code om word doc te openenProblemen is 1 dat we missing moeten gebruiken voor optionele parameters, 2 dat de elementen van het type object moeten zijnDaarna herschrijven naar simpele PIA call
  16. Use Three.VbLanguageImprovements from the LanguagesTenInOne solution.
  17. Auto-Implemented PropertiesCollection InitializersImplicit Line ContinuationMultiline Lambda Support
  18. DynamicDemoAnd Extra Dynamic DynamicObjectCalling the Random shuffler in IronPython from C# (passing in an IEnumerable&lt;int&gt; generated in C#). Use Two.IronPythonInterop from the LanguagesTenInOne solution.
  19. Tonenstringarray vragen of de assignment zalwerkenTonen stringlist  vragen of toewijzing aan Ilist werkt, vragen of toewijzing aan Ienumerable werktHanden laten opsteken(Wie denkt dat dit werkt?)
  20. Eerst zonder tonenDan code contracts toevoegenDan opzetten in compilerTonen in reflector
  21. Microsoft has made a major investment in parallel programming. In Visual Studio 2010 there are major additions that have been made: Task Parallel Library (TPL)Parallel LINQ (PLINQ)Data Structures for Parallel ProgrammingParallel Diagnostic ToolsLet’s look at the TPL:The Task Parallel Library (TPL) is a set of public types and APIs in the System.Threading and System.Threading.Tasks namespaces in the .NET Framework version 4. These types rely on a task scheduler that is integrated with the .NET ThreadPool. The purpose of the TPL is to make developers more productive by simplifying the process of adding parallelism and concurrency to applications.The TPL scales the degree of concurrency dynamically to most efficiently use all the processors that are available. Parallel code that is based on the TPL not only works on dual-core and quad-core computers. It will also automatically scale, without recompilation, to manycore computers.When you use the TPL, writing a multithreaded for loop closely resembles writing a sequential for loop. The following code automatically partitions the work into tasks, based on the number of processors on the computer.NOTE:You definitely want them to know about the Concurrency site on MSDN for parallel programming:http://msdn.microsoft.com/en-us/concurrency/My favorite demo to do here is in the training kit. Just show the parallel and non-parallel code samples:C:VS2010TrainingKitDemosParallelForLoopSourceFor more demos, sample code with links to descriptions and pretty much everything else you need can be found here:http://code.msdn.microsoft.com/ParExtSamplesThere is also a parallel demo in the VS2010 Training Kit that can be found here:C:VS2010TrainingKitLabsParallelExtensionsLab.htmlhtmlDocSet_default.html
  22. Parallel LINQ (PLINQ) is a parallel implementation of LINQ to Objects. PLINQ implements the full set of LINQ standard query operators as extension methods for the T:System.Linq namespace and has additional operators for parallel operations. PLINQ combines the simplicity and readability of LINQ syntax with the power of parallel programming. Just like code that targets the Task Parallel Library, PLINQ queries scale in the degree of concurrency based on the capabilities of the host computer.NOTE:The perfect demo here is the Baby Names example in the VS2010 Training Kit. This thing is just great for showing parallel and non-parallel code as well as visually seeing performance:C:VS2010TrainingKitDemosParallelBabyNamesSource
  23. * TaskDemo:Uitleggen wat we juist gaan doen op elke threadRunPool();  Maaktgebruik van threads op de threadpool  traag en weinigcontroleRunThreads();  Maaktexplicietalle threads aan  weinig efficientRunTasks(); Systeem beslist zelf wat de optimale hoeveelheid tasks is en maakt er optimaal gebruik van* PLinqDemo:Uitvoeren linq query zonder AsParallelDaarna opnieuw uitvoeren met AsParallel toegevoegd* ParallelDemoUitvoeren nonparallelmethod
  24. Nearly 80% of software development costs is in the maintenance of software.
  25. MESSAGING:So, if a MEF-aware application is built of parts, parts can be thought of as the “heart” of a MEF-aware application. Let’s take a look at a simple Part. In this case, it is a class called SimpleMortgageCalculator that has one dependency it needs satisfied, an ILogger. Let’s see how we would use MEF to declare the needs this part has in order to be composed.
  26. MESSAGING:So, if a MEF-aware application is built of parts, parts can be thought of as the “heart” of a MEF-aware application. Let’s take a look at a simple Part. In this case, it is a class called SimpleMortgageCalculator that has one dependency it needs satisfied, an ILogger. Let’s see how we would use MEF to declare the needs this part has in order to be composed.
  27. MESSAGING:So, if a MEF-aware application is built of parts, parts can be thought of as the “heart” of a MEF-aware application. Let’s take a look at a simple Part. In this case, it is a class called SimpleMortgageCalculator that has one dependency it needs satisfied, an ILogger. Let’s see how we would use MEF to declare the needs this part has in order to be composed.
  28. MESSAGING:Now that we’ve declared all our Imports and Exports, how are they all matched up together? This is the job of the container. The container is the “match maker” if you will. An application will ask the configured container for an object of a given type, then the container will take care of building up the entire object graph and returning the necessary object. All of this matching is handled by the container itself, the user doesn’t have to think about it at all.
  29. * Show MEFGameToon App klasse met AggregateCatalogToon Shape klasse in AdditionalShapes met GameShapeAttribute Leg uit dat deze overerft van ExportAttribute* http://devlicio.us/blogs/derik_whittaker/archive/2009/10/27/simple-kick-start-example-using-mef-preview-8.aspx