Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation TL49
XX02 YY03 Sessions with Deeper Detail
Scott Hanselman
Principal Program Manager Community Liaison Microsoft Corporation
Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation
Scott Hanselman Principal Program Manager Community Liaison Microsoft Corporation
BabySmash Client BabySmash Web BabySmash Web BabySmash Service Reporting Site w/Charts BabySmash “Big *ss Table”? 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! BabySmash Mobile BabySmash Mobile
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!
Get your copy at the AW Booth!
WebWeb CoreCore WorkflowWorkflow DataData CommComm ClientClient
WebWebCoreCore Work flow DataDataCommComm ClientClient
ClientClient
ClientClient
ClientClient
ClientClient PC46 PC07
ClientClient
ClientClient
ClientClient
Scott Hanselman
CoreCore PC49 TL02
public class ExampleClass { public int ExampleMethod(int n) { CodeContract.Requires(n > 0, "n must be greater than 0"); CodeContract.Ensures( CodeContract.Result () >= 0, "Return value must be positive"); //... } public IEnumerable 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.
CoreCore
CoreCore TL33 TL26 TL44
Scott Hanselman
DataData
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 DataData
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 LoadSQL Methods var 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(); } DataData TL20 TL07
DataData TL20 TL07
Scott Hanselman
CommCommWorkflowWorkflow &
Host (.exe, IIS, "Dublin",.NET Services, …) WF Runtime Extensions Tracking Persistence … … Tooling VS Designer VS Debugger Rehosted Designer Workflow Activity Library
CommCommWorkflowWorkflow & TL17 TL06 TL21
= CLR+BCL
Scott Hanselman PC10 Session with Deeper Detail
void 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]; } } } } CoreCore
void 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]; } }); } CoreCore
Scott Hanselman
WebWeb TL54 Sessions with Deeper Detail
WebWeb
ASP.NET Web Forms Dynamic Data MVC ASP.NET Ajax
Scott Hanselman
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); CoreCore
dynamic x = win.New.VELatLong(latitude, longitude); var pin = map.AddPushpin(x); pin.SetTitle(title); pin.SetDescription(description); map.SetCenterAndZoom(x, 7); CoreCore TL10 TL44 Sessions with Deeper Detail
Scott Hanselman
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!
DataData CommComm WebWeb CoreCore WorkflowWorkflow ClientClient
DataData CommComm WebWeb CoreCore WorkflowWorkflow ClientClient
DataData CommComm WebWeb CoreCore WorkflowWorkflow ClientClient DataData CommComm CoreCore WorkflowWorkflow ClientClient
Please fill out your evaluation for this session at: This session will be available as a recording at:
© 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.