ofir aspis 1/2010 [email protected]. vs 2010 targets high level - ide new features vs 2010 as editor...
TRANSCRIPT
Ofir Aspis 1/[email protected]
VS 2010 Targets High Level - IDE New Features VS 2010 As Editor and Platform Demo
◦ Editor features◦ Extending the IDE◦ Web MVC 2 and TDD
Break What’s new in .Net Framework 4.0 and C#
4.0◦ New Language Features◦ New Framework Application Blocks
Audience
Featu
re S
et
Minimal
Complete
Hobbyist Enterprise
ProfessionalProfessional
UltimateUltimate
ExpressExpress
PremiumPremium
VSTS Team Suitew/ MSDN PremiumVSTS Team Suite
w/ MSDN Premium
VSTS Development Ed.w/ MSDN Premium
VSTS Development Ed.w/ MSDN Premium
VSTS Database Ed.w/ MSDN PremiumVSTS Database Ed.w/ MSDN Premium
VSTS Test Ed.w/ MSDN Premium
VSTS Test Ed.w/ MSDN Premium
VSTS Architecture Ed.w/ MSDN Premium
VSTS Architecture Ed.w/ MSDN Premium
Visual Studio Professionalw/ MSDN Professional
Visual Studio Professionalw/ MSDN Premium
Visual Studio Professional
Visual Studio Standard
VS 2010 Ultimatew/ MSDN
VS 2010 Ultimatew/ MSDN
VS 2010 Premiumw/ MSDN
VS 2010 Premiumw/ MSDN
VS 2010 Professionalw/ MSDN
VS 2010 Professional
Visual Studio 2010ProfessionalVisual Studio 2010Professional
New WPF EditorNew WPF Editor
Generate FromUsage
Generate FromUsage
Customizable IDECustomizable IDE
Silverlight ToolingSilverlight Tooling
Multi-CoreDevelopment
Multi-CoreDevelopment
CloudDevelopment
CloudDevelopment
WebDevelopment
WebDevelopment
WindowsDevelopment
WindowsDevelopment
OfficeDevelopment
OfficeDevelopment
SharePointDevelopment
SharePointDevelopment
New Look & Feel
Web Deploy
web.config Transformation
Call Hierarchy
Inline Call Tree
Highlight References
Document Map Margin
Extensible Test Runner
WPF-based Editor
Sharepoint Tooling
JQuery Intellisense
HTML Snippets
Historical Debugging
Concurrency Profiler
Parallel Tasks Window
Parallel Stacks Window
Quick Search
Generate From Usage
Improved Multi-Monitor
MVC Tooling
Dynamic Data Tooling
Click-Once Enhancements for Office
64-bit Mixed-Mode
Minidump Debugging
Breakpoint Grouping
Breakpoint Labeling
Breakpoint Import/Export
New features, the tip of the iceberg…
Improved WPF Tooling
Visual Studio As An Editor
Visual Studio As A Platform
An improved focus on …
Writing code,
Understanding code,
Navigating code,
Publishing code
Demo
New Extensible Editor allows editor to be easily extended to provide a rich and robust editing experience
Online Visual Studio Gallery integrated directly into Visual Studio
Enabling the Visual Studio Ecosystem through:
Online Templates
Extensions and Extension Manager
All Contributable by Community
Demo
Beta 2, October 19th, 2009
RTM, March 22nd, 2010
.Net Framework - A Brief Review
.Net Framework 4.0 Highlights
Managed Extensibility Framework (MEF)
Managed Languages
C# 4.0 New Features
Dynamic Language Runtime (DLR)
F#
Base Class LibrariesBase Class Libraries
The CLRJIT & NGENJIT & NGEN
Garbage CollectorGarbage Collector
Security Model
Security Model
Exception HandlingException Handling
Loader & Binder
Loader & Binder
WPFWPF Win FormsWin
Forms DLRDLR ASP.NETASP.NET WCFWCF And more!And more!LINQLINQ
.NET 1.0.NET 1.0 .NET 1.1.NET 1.1 .NET 2.0.NET 2.0
3.03.0
3.53.5
.NET 4.NET 4
2002 2003 2008 CTP2005-08
CLR 1.0CLR 1.0 CLR 1.1CLR 1.1 CLR 2.0CLR 2.0 CLR 4CLR 4
SP1SP1
Client ApplicationsClient Applications
WPF 4MEF
Web ApplicationsWeb Applications
Web Forms 4AJAX 4
Client/ServerClient/Server
WCF 4
The Managed Extensibility Framework (MEF) is a new library in the .NET Framework that enables greater reuse of applications and components.
Using MEF, .NET applications can make the shift from being statically compiled to dynamically composed
Our managed languages are starting to share some very similar features:
Functional
Concise
Declarative
Imperative Declarative
What
How
Before
IList<Person> FindParentsWithChildNamed(string childName)
{var matches = new List<Person>();
foreach(var person in _people) { foreach(var child in person.Children) { if (child.Name.Equals(childName)) { matches.Add(person); break; } }
}return matches;
}
IList<Person> FindParentsWithChildNamed(string childName) }
var matches = from person in people from child in person.Children
where child.Name.Equals(childName) select person;
return matches.ToList;(){
After
Parallel LINQ (PLINQ) enables developers to easily leverage manycore with a minimal impact to existing LINQ programming model
var q = from p in people where p.Name == queryInfo.Name && p.State == queryInfo.State && p.Year >= yearStart && p.Year <= yearEnd orderby p.Year ascending select p;
var q = from p in people where p.Name == queryInfo.Name && p.State == queryInfo.State && p.Year >= yearStart && p.Year <= yearEnd orderby p.Year ascending select p;
C# 1.0C# 1.0
C# 2.0C# 2.0
C# 3.0C# 3.0
Managed Code
Generics
LINQ
C# 4.0C# 4.0
Dynamic
1. Late-Binding Support
2. Named and Optional Parameters
3. Improved COM Interop
4. Covariance and Contravariance
Consider this example:public void M(int x, int y = 5, int z = 7) { }
In this method, the parameters y and z are assigned default values. Calls to this method might look like this:
M(1, 2, 3); // ordinary call of MM(1, 2); // omitting z – equivalent to M(1, 2, 7)M(1); // omitting both y and z – equivalent to M(1, 5, 7)M(1, z: 3); // passing z by nameM(x: 1, z: 3); // passing both x and z by nameM(z: 3, x: 1); // reversing the order of arguments
Interop Assemblies translate between managed code and COM
For each interface, struct, enum, delegate, and member, contains a managed equivalent with marshalling data
Primary Interop Assemblies cause many
pain points…
1. Compilers embed the portions of the interop assemblies that the add-ins actually use
2. Runtime ensures the embedded definitions of these types are considered equivalent
Common Language Runtime
Statically-Typed
C#VB
RubyPython
Dynamically-Typed
Common Language Runtime
Statically-Typed
C#VB
RubyPython
Dynamically-Typed
Dynamic Language Runtime
PythonBinderPythonBinder
RubyBinderRuby
BinderCOM
BinderCOM
BinderJScriptBinderJScriptBinder
ObjectBinderObjectBinder
Dynamic Language RuntimeDynamic Language Runtime
Expression TreesExpression TreesExpression TreesExpression Trees Dynamic Dynamic DispatchDispatchDynamic Dynamic DispatchDispatch Call Site CachingCall Site CachingCall Site CachingCall Site Caching
IronPython
IronPython IronRubyIronRuby C#C# VB.NETVB.NET Others…Others…
Calculator calc = GetCalculator;)(int sum = calc.Add(10, 20);
object calc = GetCalculator;)(Type calcType = calc.GetType;)(
object res = calcType.InvokeMember("Add",
BindingFlags.InvokeMethod, null, new object[] { 10, 20 };)
int sum = Convert.ToInt32(res);
ScriptObject calc = GetCalculator;)(object res = calc.Invoke("Add", 10, 20);int sum = Convert.ToInt32(res);
dynamic calc = GetCalculator;)(int sum = calc.Add(10, 20);
Statically typed to be
dynamic
Statically typed to be
dynamic
Dynamic method
invocation
Dynamic method
invocation
Dynamic conversionDynamic
conversion
F# is .NET managed programming language combining functional programming and object-oriented programming.
It’s ideally suited for parallel, algorithmic, technical and explorative development
F# is a strongly-typed language like C#, but with a lightweight syntax often seen in a dynamic language like Python
“Programming in The Small” with Tuples and functions
Simple, and more error-free asynchronous programming
Strong types for floating point code
Integrated with Visual Studio 2010
let data = (1,2,3) let rotations (x, y, z) = [ (x, y, z); (z, x, y); (y, z, x) ] let derivative f x = let p1 = f (x - 0.05) let p2 = f (x + 0.05) (p2 - p1) / 0.1 let f x = 2.0*x*x - 6.0*x + 3.0 let df = derivative f System.Console.WriteLine("The derivative of f at x=4 is {0}", df 4.0)
let http url = async { let req = WebRequest.Create(Uri url) let! resp = req.AsyncGetResponse() let stream = resp.GetResponseStream() let reader = new StreamReader(stream) let! contents = reader.AsyncReadToEnd() return contents } let sites = ["http://bing.com"; "http://microsoft.com"; "http://msdn.com"; "http://msnbc.com"] let htmlOfSites = Async.Parallel [for site in sites -> http(site)] |> Async.RunSynchronously
Visual Studio 2010/.NET Framework 4.0 Training Kit◦ November Preview: http://tinyurl.com/5zf8y8
Visual Studio Topic Area on Channel 9◦ http://channel9.msdn.com/visualstudio◦ Includes videos from VS2010 and VSTS2010 weeks on
Channel 9
VS2010/NETFX4 Futures on MSDN◦ http://msdn.microsoft.com/en-us/vs2008/products/
cc948977.aspx