Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

68
Scott Hanselman Principal Program Mana Community Liaison Microsoft Corporation .NET Framework: Overview &AppsforBabies TL49

Transcript of Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Page 1: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Scott HanselmanPrincipal Program ManagerCommunity LiaisonMicrosoft Corporation

.NET Framework: Overview

& Apps for Babies

TL49

Page 2: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

What’s useful in .NET 3.5What’s useful in .NET 4.0See how things fit together

Demystify complexityEschew obfuscation

EdutainSuggest other Sessions

The Goal of This Session

XX02YY03

Sessions with Deeper Detail

Page 3: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.
Page 4: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.
Page 5: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

BabySmash!

Scott Hanselman

Demo

Page 6: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.
Page 7: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

BabySmash Co-Op

Page 8: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

BabySmash Baby Clans

Page 9: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

BabySmash Baby vs. Baby

Page 10: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.
Page 11: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

World of BabyCraft

Scott HanselmanPrincipal Program ManagerCommunity LiaisonMicrosoft Corporation

Page 12: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

World of BabyCraft

Scott HanselmanPrincipal Program ManagerCommunity LiaisonMicrosoft Corporation

Page 13: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

MMORPGBS!w/.NET

Scott HanselmanPrincipal Program ManagerCommunity LiaisonMicrosoft Corporation

Page 14: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.
Page 15: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

BabySmash Client

BabySmashWeb

BabySmashService

Reporting Site w/Charts

BabySmash“Big *ss Table”? DB

JIST: Babies smash, metrics are sent up to the server and the reporting site shows a nice histogram bell curve of what keys are being smashed. Then we take the babies’ money. PayPal FTW!

BabySmashMobile

Page 16: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

BabySmash WPF

BabySmash Silverlight

BabySmash

ADO.NET Data Service

Reporting Site ASP.NET

MVC

BabySmash

Surface SQL2k8

JIST: Babies smash, metrics are sent up to the server and the reporting site shows a nice histogram bell curve of what keys are being smashed. Then we take the babies’ money. PayPal FTW!

BabySmash Windows Mobile

Today

Page 17: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Get your copy at the AW Booth!

Page 18: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

WebCore

Workflow

DataCommClient

Page 19: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Web Core Workflow

DataCommClient

Page 20: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Client

WPFDeveloper != DesignerData BindingSurface

Deployment ClickOnce (and FireFox) .NET Client Profile

Silverlight 2Silverlight Mobile

Page 21: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Client

Page 22: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Client

Page 23: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Client

LOTS. Can’t tell you, go to the Keynote then to

PC46!

PC46PC07

Page 24: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Client

LOTS Can’t tell you, go to the Keynote then to

PC46!

PC46PC07

Page 25: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Client

LOTS Can’t tell you, go to the Keynote then to

PC46!

PC46PC07

Page 26: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Client

LOTS Can’t tell you, go to the Keynote then to PC46!

PC46PC07

Page 27: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

It' s a giant table! With a baby on it!

Page 28: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

BabySmash! Surface

Scott Hanselman

Demo

Page 29: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Core

Multi-targetingSide by Side in the

same processCode by Contract

*cough* Spec# *cough*

PC49TL02

Page 30: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

public class ExampleClass {

public int ExampleMethod(int n)

{

CodeContract.Requires(n > 0,

"n must be greater than 0");

CodeContract.Ensures(

CodeContract.Result<int>() >= 0,

"Return value must be positive");

//...

}

public IEnumerable<String> Contents

{ get; set; }

[ContractInvariantMethod]

protected void ObjectInvariant() {

CodeContract.Invariant(

CodeContract.ForAll(Contents,

s => s != null));

//...

}

}

Contracts come at the

beginning of

methods.

Precondition

stating that the

input parameter to the

method must be greater than 0 for the

method to

function properly

.

Postcondition

guaranteeing

that the result of

the method will be

positive. Callers

can count

on this.

Developers can provide a string

to be displayed when

the contract

is violated

.

All object

invariants are

contained in a single

method, which

may contain many

calls to CodeContract.ObjectInvariant and no other calls.

Guarantees that

all elements in the

IEnumerable are

not null.

Page 31: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

In-process SxS

CLR v2 and CLR v4 activated in the same processNo support for v1.0 and v1.1

New Host APINew Activation Policy

Core

Page 32: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Core

Parallel LINQSystem.NumericsMEF - ComponentModel.CompositionSystem.XamlSystem.Threading

SpinLock, Parallel, LazyInitSystem.IO.MemoryMappedFiles“Dynamic”

TL33TL26TL44

Page 33: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

MEF

Scott Hanselman

Demo

Page 34: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

My New Friends

Page 35: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

My New Friends

Page 36: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

My New Friends

Page 37: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Data

LINQ to SQLEntity FrameworkADO.NET Data ServicesSQL 2008

Page 38: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

ADO Data Services Semantics

Underlying data model - Entity Data Model - Entities Resources - Associations Links

Operation semantics - Mapping of HTTP methods - GET retrieve resource - POST create resource - PUT update resource - DELETE delete resource

Data

Page 39: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Entity Framework v2

using (NorthwindContext context = new NorthwindContext()){ //--- EF LINQ query with POCO Product var products = from p in context.Products select p; foreach (Product product in products) { //--- Lazy load the Category Console.WriteLine(String.Format("{0}:{1}", product.ProductName, product.Category.CategoryName)); } }

POCO & Lazy Load

SQL Methodsvar people = from e in context.Employees where EdmMethods.Month(e.BirthDate) == EdmMethods.Month(NorthwindContext.MyGetUtcDate()) select e;____________________________________________________________________________________ [EdmFunction("SqlServer", "GETUTCDATE")] public static System.DateTime? MyGetUtcDate() { throw new Exception(); }

• New Stored procedure Capabilities• TVF Support• Query Re-Writing• New n-tier API’s• Model Defined Functions• Template Based Code-Generation

Data

TL20TL07

Page 40: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

ADO.NET Data Services v2

Data bound UI Enhanced data binding support in .NET and SL client library

Performance Enhancements Query caching

Working with BLOB content Automatic BLOB deferral Server side media link entry support

Mashups Support microformats in feeds Map Entity properties to ATOM-defined elements

REST interface extensions Server driven paging Expose # results in a set as a URL

Data

TL20TL07

Page 41: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

BabySmashSmashy Services Scott Hanselman

Demo

Page 42: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Comm

WCFWeb ServicesUnified StackConsume from Silverlight

RESTServiceModel.SyndicationADO.NET Data Services

Workflow

Workflow&

Page 43: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Host (.exe, IIS, "Dublin", .NET Services, …)

WF Runtime Extensions

Tracking

Persistence

Windows Workflow Foundation (WF) 4.0WF programs

coordinate work with minimal ceremony

It’s ART:ActivitiesRuntimeTooling Tooling

VS Designer

VS Debugger

Rehosted Designer

WorkflowActivity Library

Page 44: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Why Workflow?Coordinate Asynchronous WorkWrite Persistable ApplicationsGain Visibility into your

ApplicationCustomizable Vocabulary &

Design Experience

Comm Workflow&

TL17TL06TL21

Page 45: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

MEF (Beta)

= CLR+BCLBabySmash Line of

Business

Page 46: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

BabySmash!Silverlight 2for Mobile

Scott Hanselman

Demo

PC10

Session with Deeper Detail

Page 47: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Agenda – What is the point of this talk?

Page 48: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Parallel Programming Example

Sequentialvoid MultiplyMatrices(int size, double[,] m1, double[,] m2, double[,] result) { for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { result[i, j] = 0; for (int k = 0; k < size; k++) { result[i, j] += m1[i, k] * m2[k, j]; } } } }

Core

Page 49: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Parallel Programming Example

Parallelvoid MultiplyMatrices(int size, double[,] m1, double[,] m2, double[,] result)

{ Parallel.For(0, size, i => { for (int j = 0; j < size; j++) { result[i, j] = 0; for (int k = 0; k < size; k++) { result[i, j] += m1[i, k] * m2[k, j]; } } }); }

Core

Page 50: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

MasssivelyParallelBabies

Scott Hanselman

Demo

Page 51: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Web

ASP.NET WebFormsASP.NET MVC (Beta)ASP.NET Dynamic DataASP.NET Ajax

AJAX Control Tookit jQuery

Silverlight 2Hybrids welcome!

System.Web.Routing TL54

Sessions with Deeper Detail

Page 52: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Web

ASP.NET Web Forms 4.0Control over your HTML & ViewStateASP.NET Ajax 4.0 + Templating jQuery embraced, not eatenCharts

ASP.NET Dynamic Data 2.0ASP.NET MVC + Dynamic DataSilverlight 2

Silverlight Toolkit and Controls

Page 53: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

ASP.NET > Web Forms

ASP.NET

WebForms

Dynamic Data

MVC

ASP.NET Ajax

Page 54: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

TPS Reports (and TPS Charts!)

Scott Hanselman

Demo

Page 55: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

DOM interop pre DLR

ScriptObject x = win.CreateInstance("VELatLong",latitude,longitude);

ScriptObject pin = (ScriptObject)map.Invoke("AddPushpin", x);pin.Invoke("SetTitle", title);pin.Invoke("SetDescription", description);map.Invoke("SetCenterAndZoom", x, 7);

Core

Page 56: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

DOM interop with DLR

dynamic x = win.New.VELatLong(latitude, longitude);var pin = map.AddPushpin(x);pin.SetTitle(title);pin.SetDescription(description);map.SetCenterAndZoom(x, 7);

Core

TL10TL44

Sessions with Deeper Detail

Page 57: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

http://tinyurl.com/bigdemo

Scott Hanselman

Big Final Demo

Page 58: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

BabySmash WPF

BabySmash Silverlight

BabySmash

ADO.NET Data Service

Reporting Site ASP.NET

MVC

BabySmash

Surface SQL2k8

JIST: Babies smash, metrics are sent up to the server and the reporting site shows a nice histogram bell curve of what keys are being smashed. Then we take the babies’ money. PayPal FTW!

BabySmash Windows Mobile

Today

Page 59: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

DataComm

WebCore

Workflow

Client

Page 60: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

DataComm

WebCore

Workflow

Client

Page 61: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

DataComm

WebCore

Workflow

ClientData

Comm

Core

Workflow

Client

Page 62: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.
Page 63: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.
Page 64: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Kit George and Brad Abrams Grant Archibald - http:/garchibald.com Giorgio Sardo and Amit Chopra Rob Conery Stephen Toub Felix Corke & Richard Griffin – Conchango Robert Levy – Surface John Bowen and Interknowlogy Jason Olson

Credits

Page 65: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Evals & Recordings

Please fill

out your

evaluation for

this session at:

This session will be available as a recording at:

www.microsoftpdc.com

Page 66: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

Please use the microphones provided

Q&A

Page 67: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.

© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market

conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Page 68: Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49.