Joseph Guadagno

Rants, Raves and other stuff about ASP.NET development.

October 2008 - Posts

PDC 2008 Experience: Day 4: Session = "Microsoft Visual Studio: Customizing and Extending Your Development Environment"

Agenda

  • Extending Visual Studio
    • Finding Extensions on VS gallery
    • Using the SDK to create packages
    • Created branded, stand alone application
  • Visual Studio 10 Extensibility
    • Customizing the Start Page
    • Building "drop in" component with MEF
    • Extending the VS 10 editor
    • Managing extensions and downloads

Extend your Development Experience

  • Find Tools
  • Customize Visual Studio
    • Templates
    • Code Snippets
    • Macros
    • Start Page
    • Debugger Visualization
  • Build new Tools
    • Add-ins
    • Packages
    • Designers
    • DSL
    • Editor components

Custom Packages: ToolWindow

  • Create custom tool windows
  • Content
    • XAML viewer
    • Developer Tool Extensibility actions
  • Use SDK sample browser to initiate
  • Visual Studio 10 changes
    • WPF shell

Isolated Shell

Can deploy Visual Studio IDE shell itself, Visual Studio 2008 Shell

  • Empty IDE
  • Free redistribution

Steps to Build and Deploy

  1. Visual Studio Extensions
    1. Packages
    2. Content
    3. Help
  2. Custom Shell
    1. Branding
  3. Register the new shell

What's New

Customizing the new Start Page

  • The start page is XAML which you can put whatever you want on it.
  • Stored in Documents/Visual Studio 10/Start Pages

Components

New Managed extensibility mechanism designed from ground up

  • All managed - no COM artifacts
  • Component and contract based
  • Used for emerging Visual Studio architecture
  • Appears first in the editor
  • Characterized by ease of construction and deployment...
    • Self describing payloads, "xcopy" semantics
    • DILU (drop in light up) deployment
    • *not* focused on hot deployment in the first release

MEF In the Visual Studio Editor

  • The new editor is built entirely from MEF components
  • Extending or modifying the editor amounts to providing you own components
  • Many extensibility points designed to capture common edits

Classification: Rich Text Formatting

  • Rich reading experience
  • Multiple font
  • Font styles and effects
  • Opacity
  • Higher Performance
    • Fewer coloring requests to language services
  • Composible
    • 3rd party "mixins" easily supported
    • Per-line transformations
  • You can also create your own colorizer for code, by word, phrase, etc.

Adornments: Powerful graphs

  • Any WPF visual
    • Drawn on one of several planes
  • two tracking modes
    • Associate with text
    • Associate with screen
  • Animation and behavior

Margin and Scrollbar control

  • Replace or customize existing margins and scroll bar
  • Define new margins
    • all four sides
  • Support for spatial mapping
  • Similar to "JetBrains ReSharper Panel"

Intellisense and Smart Tags

Any 3rd party (not just language services) can

  • Contribute to Completion
  • Override the presentation of Parameter Help or Quick Info
  • Add menu items to Smart Tags

Managing your extensions

  • What if you could discover and search for extensions within the IDE?
  • What is you could install, manage, and update extensions there as well?
  • What if we could make publishing IDE extensions (of all flavors) easy, fast, and fun?

Extension Manager

  • New "in situ" experience for extensions...
    • Discover (via VS Gallery)
    • Download/install/manage
    • Update
  • Simplified packaging and deployment
    • Same DILU semantics, but for both existing and new extensibility mechanisms
    • Xcopy deploy; no magic, no hidden state
      • Think unzip and a manifest in XML
    • VS SDK will deliver simplified authoring and "one step" publication story
    • Used by Visual Studio and 3rd parties.
PDC 2008 Experience: Day 4: Session = "WCF: Building RESTful Services"

WCF (Referred to as DUB CF).

Content Driven Web Architecture

  • The Browser
    • Generic client experience
  • URI's
    • Addressing and identification
  • HTML
    • Common presentation formal
  • Hyperlinks
    • Anarchic interconnectivity
  • HTTP GET
    • Ubiquitous operation for retrieval (the should be now side effects of a GET)

Capability Enabled Web Architecture

  • Rich Browser Clients
    • Programmability via script or plugins
  • HTTP
    • Baseline application protocol
    • Common set of operations + status codes
  • Domain-neutral data-oriented formats
    • XML
    • JSON
    • Atom/Atom publishing
    • Refine to support domain-specific schemas
  • Presentation formats
    • HTML
    • CSS

RESTful Tenants

  • The Web is a graph of linked resources
  • Resources are identified by URI's
  • Resources support a fixed set of operations
    • In practice, these are defined by HTTP
  • Application follow links to achieve late binds

REST is an architecture style*, not a specification

* see Fielding: http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

[WebGet] and [WebInvoke]

  • Binds a WCF operation to URI space and HTTP method
  • Indicate the HTTP Method for the operation
    • WebGet - Don't make me write it
    • WebInvoke

UriTemplate

  • String that allows you to define the structure of the URI, as well as to define "Holes"
    • The "Holes" are variables
    • You bind the template with parameters to fill the holes
    •    1: [OperationContract]
         2: [WebGet(UriTemplate="product/{productId]")]
         3: Product GetProducts(string productId)

webHttpBinding

  • New "web-friendly WCF Binging in Fx 3.5
    • Allows for the development of RESTful

WebServiceHost

  • SepcializedServiceHost for RESTful services
    • Eliminates need for lots of configuration
    • Automatically configures address, binding, contract
  • Optimized fro single end-point services

WCF REST Starter Kit

Available for download at http://msdn.com/wcf/rest

  • Extensive REST Samples
  • Visual Studio Templates
    • REST Collection / Singleton Services
    • Atom Feed / Atom Publishing Protocol
    • HTTP/ POX services
  • Microsoft.ServiceModel.Web.dll
    • Preview of additional framework features
    • Binary included in Starter Kit
    • Buildable source available on CodePlex
  • RESTful meta data

Resources

PDC 2008 Experience: Day 3: Session = "Building Mesh-Enabled Web Applications Using the Live Framework"

Read about the Live Framework

Download the Live Framework Diagram

Download the Live Framework CTP

Live Services for Applications

  • Application Analytics
  • Synchronized Storage
  • Membership and Identity
  • Timely News
  • Deployment to devices
  • Servicing and Update
  • Application Catalogue
  • Hosting and Execution
PDC 2008 Experience: Day 3: Session = "Oslo: Repository and Models"

A Repository Database

  • Optimized for storing and sharing models
    • designed for extensibility
    • allows fro query, linkage, impact assessment across models
    • supports common tasks such as versioning, access control
    • extensible meta data enables rich tooling
  • includes end-to-end system/lifecycle models
    • out of the box models
    • design-time , run-time
  • "Natural" SQL Server database
    • approach leverages database eco-system
    • It is an application that sits on top of SQL Server

Repository capabilities

  • Repository features are built on SQL Server
    • Repository install also turns on useful features

Oslo Models

  • Identity
    • System.Identity
  • Application
    • System.Runtime
    • System.Application
    • Document
  • ServiceModel
    • System.ServiceModel
  • Transactions
    • System.Transactions
  • WorkflowModel
    • System.WorkflowModel
    • Ssytem.Workflow.Activities
  • WorkflowServiceModel
    • System.WorkflowServiceModel
    • System.WorkflowServiceModel.Activities
  • Messaging
    • System.Messaging.Adapters
  • Security
    • System.Security

... and more

Adding Your Models to the Repository

  • The Oslo SDK provides tools to
    • Define new models:
      • Intellipad
      • Visual Studio language services
    • Compile models
      • m.exe
      • msbuild build task
    • Deploy Models
      • mx.exe
  • Once they're in the database, it is just SQL

Core Services of the Repository

  • Deployments
  • Security
  • Catalog
  • Versioning

Deployment

  • MX.exe packages SQL for deployments to Repository Nodes
    • Packages can come from M files
    • Packages can be exported from Repository nodes
  • Application model can be used to define applications to be deployed
    • define a web service in the Repository and deploy it without writing a line of code

Security

  • Security is claimed based
    • Identity becomes just one of several possible claims
    • Claims presented to authorize operations against resources
  • Repository tables keep track of claims, resources and operations
    • Triggers implemented on  /t:Repository generated views to check claims.
    • Views protect against direct access to tables.
  • Domain Specifc security containers
    • Use folders to partition data
    • Apps decide which data goes into what folder
    • Security check happen on folder boundaries
    • Must call the field "Folder" for compiler to find it
    • Folder ID must exist the Item.Folders table
    •    1: model Friendship
         2: {
         3:     type F
         4:     {
         5:         Id: Integer32
         6:         Name : String
         7:         Folder: Integer
         8:     }
         9: }

      Catalog

      • SQL Server has a catalog
        • List of tables
        • List of Views
        • List of Stored Procedures
        • and the relations between them
      • Repository has its own catalog
        • Extends SQL Server catalog
        • Adds information about relationships modules, types and extends
      • Useful for
        • Rich export
        • Impact Analysis
        • Enriched SQL data access code.

      Versioning

      • Data change synchronization
        • Between nodes using SQL Server Replication and Occasionally Connect Systems (OCS)
        • Import/Export using SQL Server Change Tracking
          • repository <-> file system
      • Schema evolution
        • Extend M type and provide backwards compatibilities for old client with computed values
        • SQL Server Integration Services for data migration

      Where are we?

      • Repository is optimized for many reads few writes
      • Contains models for "Oslo" app domains
      • Can be extended with M
      • Models can be deployed, secured and versioned
      Posted: Oct 29 2008, 05:07 PM by jguadagno | with no comments
      Filed under: , , ,
      PDC 2008 Experience: Day 3: Session = "Improving Code Quality with Code Analysis"

      Benefits of Code Analyst

      • Bugs take more time to fix in production and cost more once they get released.
      • More secure code
      • Make your applications more reliable
      • Make your code more maintainable
        • Use good variable names
        • Use spell check

      Integrating into you team work flows

      Tools

      • Code Analyst in Visual Studio Team System
      • Use FxCop

      Setup Code Analysis for your team

      1. Run Code Analysis
      2. Fix or baseline your issues
      3. Create work items for future tracking
      4. Setup Code Analysis check-in policy
      5. Setup Team Build with Code Analysis.
      6. Expanding Analysis by customizing rules.

      Best Practice

      • Focus on the most critic issues
        • Run Code Analysis with Microsoft Minimum Recommended rules and dial it up from there
      • Get into a known state
        • Fix or baseline and track deferred work
      • Use Code Analysis early and often
      • Prevent new issues
      • Don't defer potential security issues
      • Enable code analysis is Team Builds
      • Drive Quality Upstream!
      PDC 2008 Experience: Day 3: WCF 4

      Challenges

      • Work is increasingly distributed
      • Coordination code created complexity
        • Coordinating messages with application state
        • Coordinating call to a database or another service
        • Coordinating rain day scenarios
      • Management and tracking of distributed work is difficult

      What is WF (Dub F)?

      • WF programs coordinate work with minimal ceremony
      • Activities
        • Activities are the primitive abstraction for behavior
        • Activities define arguments to declare the type of data that can flow into or out of an activity
        • Activities are composable with other activities
        • Activities bind arguments to in-scope variable
      • Runtime
      • Tooling

      WF

      Helps you ...

      • Coordinating Asynchronous Concurrency
      • Coordinating Asynchronous Work
      • Coordinate Error Handling
        • Exceptions
        • Flow transactions
        • Compensation  / Cancellation (Clean up state)

      Provides

      • tons of more activities
      • better designer
      • better properties to configure
      • Contract editor
      Posted: Oct 29 2008, 12:16 PM by jguadagno | with no comments
      Filed under: , , , ,
      PDC 2008 Experience: Day 3: Keynote

      Well in the pre keynote, PDC2009 was announced. PDC2009 will be in Los Angeles, CA happening Nov 17th - November 19th, 2009.

      Microsoft Research

      Talk is mostly about what Microsoft research does and why it exists.

      • Source of IP and new Products
        • MSR generates roughly 25% of the company's patents and generally MSR patents are more "fundamental"
      • Problem Solving
        • Ability to bring smart people to bear rapidly on hard problems confronting products.

      Basic Research -> Agility

      • Basic research group allows a company like Microsoft to respond more rapidly to change.
      • Research provides a reservoir of technology, expertise and people that can be quickly brought to bear
        • New technologies
        • New competitors
        • New business models

      New Technologies

      DryadLINQ and Dryad

      • Harnessing the Power of cluster computing
      • Automatic query plan generation by DryadLINQ
      • Automatic distributed execution by Dryad

      Energy and Environment

      Photo-0003

      Microsoft mapped out the cooling system in the convention center to analysis the use of the energy.

      Microsoft uses these same sensors to determine the hot spots in there data sensors.  They use these sensors to manage and regulate the energy used in the data centers.

      You can participate in the sensor map (if you have the hardware, go to http://atom.research.microsoft.com/sensormap for more information.

       

       

      Healthcare

      • DNA mapping
      • HIV Research: Monitoring the HIV mutations, identified many of the mutation characteristics.

      Education

      • Built software for Tablet PCs for kids
      • Center for Personal Robotics in Education
      • World  Wide Telescope
        • Web 2.0 browsing environment for large distributed image and information data sets with integrated rich media authoring and annotation sharing.
        • Equinox Release: Microsoft Worldwide Telescope: 3D view of the universe
          • Zoom in and out in 3D
          • Sort of like PhotoSync for space.
      • Boku
        • A system for allowing kids to learn to program on their own.
        • Lightweight programming for kids

      SecondLight

      • They are trying to project on to surface not part of the initial surface.
        • They hovered a sheet of paper over a Surface computing desktop and it projected a completely different image on the sheet of paper.
      PDC 2008 Experience: Day 2: Attendee Party

      Universal Studios here we come... well almost. The bus company Stellar was less than Stellar, they could have benefited from some load balancing. It took me 45 minutes to get back to the hotel in what could have been a 15 minute walk.  I guess I should have walked, then the was the made rush to Universal, well we eventually got there and had some fun.  Free drinks, food, rides and scares (at least for some).

      Here are some of the pictures.  For all of the picture check out my Flickr feed.

      PDC08 - Day 2 - Attendee Party 119

      Look ma, two beers for me and a Diet Coke and White Wine for my wife.

       PDC08 - Day 2 - Attendee Party 046 PDC08 - Day 2 - Attendee Party 065

      Some of the escalators were long.

      .PDC08 - Day 2 - Attendee Party 048

      can't forget with all of the announcement we have "M" the ride

      PDC08 - Day 2 - Attendee Party 054

      Simpson's the Ride

      PDC08 - Day 2 - Attendee Party 026

      Bill and Ted Halloween Adventure was funny and awesome.

      PDC08 - Day 2 - Attendee Party 117

      Posted: Oct 29 2008, 09:45 AM by jguadagno | with no comments
      Filed under: ,
      PDC 2008 Experience: Day 2: Entity Framework Futures

      The Data Platform

      Layers of the data platform

      The Data Access Layer -> Integration aggregation sync --> Reporting and Analytics -> Management deployment policy and security --> Models and Workflow

      Joining the layers together

      • Core storage
      • Data access API's and frameworks
      • Mid-tier frameworks and technologies
      • Client technologies

      Consumer Segmentation

      This missing from the first version of the Entity Framework

      • Tradition data developer (basic ADO.NET developer)
      • Scripting / rebel frameworks (Struts, nHibernate, ActiveRecord, Domain Driver Design)
      • LOB scripting / macro writers (SharePoint, Excel developers)
      • Information Worker (The typically office user)

      The Entity Framework v1 was geared towards

      • Model centric data developer (Enterprise Architects)

      A Lap Around Framework v2

      Entity Creation from Code

      • The Entity framework tries to map your database table to your C# class automatically. NO MAPPING FILES REQUIRED.
        • If the table names and or fields are different you can map it with attributes
        •    1: [TableMapping(Schema="sys", TableName="tables")]
             2: [ColumnMapping(PropertyName="TableKeyKey", ColumnName="object_id")]
             3: [Key(PropertyName="Id")]
             4: public class MyTableObject
             5: {
             6:     public int Id { get; set;}
             7:     public string Name { get; set;}
             8: }

      Entity Creation from Model

      You will be able to create entities from a drag and drop designer within Visual Studio.

      Creation from a Framework Perspective

      • Support for deferred loading
      • Support for table value functions
        •    1: public void TvfDemo(DataContext context)
             2: {
             3:     var cp = from in context.Products
             4:             where p.ProductID == 799
             5:             select new {Product=p, Customers = context.GetCustomersForProduct())};
             6:  
             7:     foreach(var o in cp)
             8:     {
             9:         Console.WriteLine(o.Product.Name)
            10:         {
            11:             foreach(customer c in o.Customers)
            12:             {
            13:                 Console.WriteLine(c.Name);
            14:             }
            15:         }
            16:     }
            17: }

      • Support for model driven functions (the functions a created with the model or XML representation of the model)
        •    1: // c.FirstName + c.LastName;
             2: c.FullName() 

      Other Features

      • You can create complex types (Types with multiple properties)

      Entity Framework, EDM, and Oslo

      • EDM and Entity Framework could be domains in Oslo
      Posted: Oct 28 2008, 07:35 PM by jguadagno | with no comments
      Filed under: , ,
      PDC 2008 Experience: Day 2: "Oslo" the language

      What is "M"?

      • "M" is a language for definig domain specific models and textual domain specific languages (DSLs)
      • M domain models define schema and query over structured data
        • Values, Constraints, and Views
        • Natural project to SQL
      • M DSLs define projections from Unicode text to structured data
        • Rule based transformations
        • Grammar driven text editor integrations.

      What "M" is not

      • An object-oriented language
        • No polymorphism, virtual dispath
        • "Is-a" determined based on structural subtyping, not stipulation
      • A data access technology
        • M domain models compile down to T-SQL
        • Tool chain supports course-grained loading/unloading of schemes and values - not an OLTP solution
      • A replacement for T-SQL
        • Far less expansive feature set
        • Tool chain supports linking/invoking T-SQL

      How it works

      Model.M M.EXE Model.mx MX.EXE SQL
      Model Compiler Image File Domain Model Loader  

      Sample Model

      contact.mx

         1: module Contacts
         2: {
         3:     People
         4:     {
         5:         { Name = "SEVDNUG", Age = 23 },
         6:         { Name = "Joseph Guadagno", Age= 21 }
         7:     }
         8: }

       

         1: module Contacts
         2: {
         3:     People:
         4:     {
         5:         Name: Text where value.Count <=28;
         6:         Age : Integer32;
         7:     }* where identity Name;
         8:  
         9:     People
        10:     {
        11:         Joseph = { Name = "Joseph Guadagno", Age = 38},
        12:         Deidre = { Name = "Deidre Guadagno", Age = 38},
        13:     }
        14:  
        15:     type Marriage
        16:     {
        17:         SpouseA : People;
        18:         SpouseB : People;
        19:     }
        20:     Marriages : Marriage*;
        21:  
        22:     Marriages {
        23:         { SpouseA = People.Joseph, SpouseB = People.Deidre }
        24:     }
        25:  
        26:     PeopleNamed(n : Text)
        27:     {
        28:         // People where value.Name == n
        29:         People.Name(n)
        30:     }
        31: }

      People:  defines the types

      People created the data

      type Marriage defines a relationship

      Marriages applies the relationships

      PeopleNamed A function to print the names

      Command line to compile it

         1: mx /i:contacts.mx /d:window /c /f

      Domain Modeling Constructs

      • Extents declare storage fro values
      • Types constrain values in a given context
      • Explicit identity enabled references
      • Functions name parameterizes expressions.

      The M Framework

      • M is implemented as M DSL
        • Parser exposed using M DSL machinery
        • Type flow exposed as framework component
      • SDK ships with an evaluator (MrEPL) that builds on both.

      Where are we?

      • "M" is a textual moding language for defining domain models and textual DSLs in Oslo
      • "M" domain models based on values, views and constraints
      • "M" domain models have a natural projection to SQL
      Posted: Oct 28 2008, 05:12 PM by jguadagno | with 2 comment(s)
      Filed under: ,
      More Posts Next page »