March 2008 - Posts

IMAGE_00094

Atom Syndication Format

  • IETF RFC 4287
  • XML format
  • Organized in feeds, entries and links
  • Extensible data and metadata

Atom Publising Protocol

  •      IETF RFC 5023
  •      Protocol for publishing and editing resources
  •     Represents over HTTP
  •     Simple RESTful interaction model

Demo Photos:

https://cumulus.services.live.com/{id}/AtomSpacesPhotos

-Authorization  via LiveID http://dev.live.com/liveid

-Browse and create folders and photos

  •    Folders/Photos as Atom feeds and entries
  •    Photos are Atom "media link entries"

<feed>

    data

     <entries>

         data

           <content type> like jpg with src url.

Edit link in atom. Links to just an entry.

<link> Uri to location

    <LP:Properties> ID Version of content within content.

PUT POST via Http is accessible.

Some of the control mechanisms:

  • Service metadata /$metadata
  • Presentation control $orderby, $filter, $top, $skip, $expand
  • Access primary value url/$value

 

Post at feed level.

scalar pull in item

set pull in set

Over any HTTP stack within AtomPub libraries Using ADO.NET (Astoria) Data services Framework.

Windows live is trying very hard to be like flickr,Amazon S3,Google Docs and etc...

 

Note:

foreach(Folder f in svc.Folders)

WebClient c = new WebClient();

c.headers["Authorization"] = "DelegatedToken dt=\"" + DelegationToken

using(Stream s= c.OpenRead(string.Format(Svc, CID) + "/Folders"))

var feed = SyndicationFeed.Load(XMLReader)

foreach (SyndicationItem item in feed.Items);

{

Dropdownlist1.Items.Add(item.Title.Text);

}

 

Tie anything Windows live into Silverlight using AJAX libraries driven by Entity Data model.

Note: var q = svc.CreateQuery<photo>(/Folder("+ id + ")/Photos");

New in Visual Studio 2008?

  • DataServiceDataSource
  • DatacontextType

 

Very cool.

Did I mention Pablo is a GURU of Data Connection(services)

 

 

 

http://www.hanselman.com

scotths@microsoft.com

  • New web project type for asp.net
  • More control over your </html>
  • Testable framework
  • Not for everyone

Master Cheif GU!

.NET 3.5 MVC web application template.

Options:

  • Enable testing right out the gate. NVUnit or any Unit.
  • No testing option

System.Web.MVC  System.Web.Extension System.Web.Routing [Namespace]

Controllers Models and Views

   Controller is a base class Index and about public class's {controller/action}  Direct relationship.

Flexible Fundamental, Plays well with others, Dry or Simple don't repeat yourself.

 

Clean Separation of Concerns

  •     Easy Testing
  •     Red/Green TDD
  •     Highly maintainable applications by default

Extensible and Pluggable

  •    Support replacing any component of the system

Driving Goals:

Enable clean URLS and HTML

   -SEO and REST freindly URL structures

Great integration within ASP.NET

MVP vs. MVC

Presenter: Up front presentation

Controller: Component

AJAX with MVC? Cannot Drag the ajax controls to the page.

-AJAX can be used but all code behind.

MVC RTM: When Duke Nukem Forever comes out.

 

Security: Is it safe? Same as ASP.NET!

Performance/Scalability Only as good as you write it.

MVC what is it?

  • Browser requests /Products/
  • Route is determined
  • Controller is activated
  • Method on Controller is invoke
  • Controller does some stuff
  • Renders View, passing in custom ViewData
  • URLs are rendered, pointing to other Controllers

Request->HTTP Routing->Route->Route Handler->Http Handler-> Controller-> View Engine-> View-> Response

Clean code!

URL Routing Pretty URIs -Developer adds routes to a global RouteTable -Mapping creates a RouteData -a bag of key/values

Route Testing for URLs Very SEO friendly.

Views

Controllers

Models

Routes

are all Pluggable

ViewEngineBase

   View Engine render output

    You get WebForms by default

Implement your own.

  •   MVCContrib Brail Nvelocity
  • NHaml

View Engines can be used to offer new DSLs to make Html easier.

Making Microformats.

 

<% { %>

code between

<%}%>

Mockable Intrinsics:

HttpContextBase, HttpResponseBase, HttpRequestBase

Extensibility:

IController, IControllerFactory, IRouteHandler,ViewEngineBase

RhinoMocks or TypeMock

Create Tests of the runtime.

For loop on front end?

 

March 18-20 2009 next year. MIX09

*Not the official transcript in any way.

Notes from the keynote:

Guy Kawasaki and Steve  Ballmer

IMAGE_00092 

Yahoo is another step to get Microsoft into the advertisement and search game.

Steve barks at Guy Kawasaki

Vigor and Energy! - Steve Ballmer

Facebook? Whats up? Looking for an advertisement platform

Microsoft $60 billion a year.

Passion for Developers - Steve Ballmer

Steve is right we have Passion!

IMAGE_00093

Three kinds of day:

  1.    Out of redmond sales and such
  2.    Doctors in his office. Meetings boom boom boom!
  3.    Research (Steve's Day)

60 pieces of email. A day. Steveb at microsoft dot com. Human beings are not abusive.

Guy  is giving Steve kudos about Microsoft products.

10 to 11million xbox live members. Wow!

No compromises for connectivity and making life easier.

Guy questions about Vista: Steve goes after Guy and his apple. Where is the dvd drive.

Steve talks about Microsoft loss of focus? No loss of focus just broadening horizons. Multiple products and services.

Vista talk. Steve keeps a positive aspect of windows vista.

Ah Firefox and IE talk. Steve working hard to catch up using IE8.

Social Networking: Fad? Using Internet to make new friends and create contacts.

Opening up API for msn live. Share point and Active Directory has open API now.

Guy mentions that Microsoft is much more now approachable.

The Adobe question: What about adobe and silverlight? Huge competitor.

Audience Questions:

Yahoo using PHP how will Microsoft transition into Asp.net?

Microsoft will  become a php and asp.net shop.

Google has the market share. Microsoft is working hard and purchasing companies to catch up.

Fast Search product purchased by Microsoft and what is the future.

HyperV integrated into windows server. Will Microsoft make storage available in the cloud.

Windows mobile platform is very large. What is future? Danger is going to be a stack. Service application experience.

When is Silverlight coming for hotmail? Microsoft.com has it and the platforms will change.

Health Solutions Plan? Health care industry is going to be a huge jump. Consumer health side need to find out how to make individual records available.

Format wars. Will xbox360 support BlueRay eventually as well as windows.

Web Developers Need Dance monkey boy.

This was cool!

Very good Keynote. Thanks Steve and Guy!

 

 

 

How to reverse a string demo. *you need to know this if you want a job at Microsoft.

public string someMethod(string, input)

{

char[] chars = input.ToCharArray();

Array.Reverse(chars);

return new string(chars);

}

Go ahead and cheat. its ok.

Using new features in .NET 3.5 Framework. blogs.msdn.com/justinsmith

IMAGE_00090

IMAGE_00091

 

What in .NET 3.5 for services:

 

  • The New HTTP Programming model:
  • New support JSON Services
  • Syndication in .NET 3.5

Service Stack Evolution

-Sockets->HttpListener->ASP.net->ASMX->WCF

WCF

one stop shop for services

Myth:WCF is only for enterprise services

Reality:WCF gets around(enterprise and web)

.NET 3.5 WCF web-centric upgrades:

  •    Make REST a 1st class citizenish
  •    Embrace SOAP-less representations
  •      JSON messaging capabilities
  •      Simple working with POX
  •     RSS & Atom syndication support

Run in partial trust (hosting) cool!

Promote web concepts to top status by simplifying the (mapping URIs to application logic, working with HTTP methods and working with Response codes & HTTP Headers)

Support for SOAP/RPC & REST from one or same application.

 

.NET 3.5 additions:

System.UriTemplate

  •    Type for modeling URI to app semantics
  •     Bind Data to a template, output to URI
  •    Match a URI to a template, retrieve data

System.UriTemplateMatch

  •     Returned from UriTemplate "match"
  •    Get relative paths

System.UriTemplateTable

 

Simple URI-to-application mapping -Defaults to query string parameters

 

Http verbs in WCF Contracts

  •    All HTTP GET POST PUT DELETE
  •    View it vs Do it separation mimics web

Specify Data Format in WCF:

WebOperationContext.Current provides access to incoming request headers

  • Can also set outgoing response headers

Bindings and ServiceHosts:

WebHttpBinding and WebServiceHost

  • Use WebServiceHost/Factory in most cases

WebHttpBinding endpoint on a ServiceHost

  • Add webhttpBehavior to the endpoint

Interpretive dance of solution for DEMO.

Cassini for services. Sounds fun.

How to reverse a string demo. *you need to know this if you want a job at Microsoft.

public string someMethod(string, input)

{

char[] chars = input.ToCharArray();

Array.Reverse(chars);

return new string(chars);

}

Go ahead and cheat. its ok.

0 config setup. Service host holds your config info.

use imperative 'approach"or web.config is by default.

 

JSON-centric Types:

  • JsonReaderWriterFactory

  -creates XmlDictionaryReader/Writer objects

  • DataContractJsonSerializer

  -Bridges objects & JSON

JSON messaging:

  Set requestsFormat/ ResponseFormat

WebHttpBehavior to endpoint

Intergrates with ASP.net AJAX

  WebScriptEnablingBehavior to endpoint

                      or

Use WebScriptServiceHost/Factory for automatic endpoint creation (0 config)

 

I have got to get working on this.

 

Microsoft Data Platform

Rich data services from SQL Server

Using of course SOAP REST and APP within SQL Server SSDS.

Live contacts has ADO.NET Connections...

SYNC Framework synchronize contacts between endpoints.

pulling or GET from url into xml or web service.

Metadata file with Vcard info.

No invoke needed within browser just service on box?

SQL Server Data Services:

  • Application Agility
  • Scales without limits
  • Business Ready SLA

Scalable or downgradable to 2005 or 2000?

SQL Server Data Services Layers:

  1. SQL Server Data services
  2. SQL Server Data Services Platform
  3. Global Foundation Services

'ACE' concepts:

Authority - Dns Name

Container - Unit of consistency/search. No schema required.

Entity - Property of name/value pairs. Update/change

Syntax:

<Entity>

   <s:container>

      <s:Id />

      <s:version>

       <strprop/>

    </s:container>

</Entity>

Need to find SSDS explorer.

data.sitka.microsoft.com

SSDS syntax is very close to LINQ syntax.

Demo was a Simple REST POST

Service runs on SYNC framework

Entity:

  Flexible Entity Model

  •     Smallest unit of measure(unit of update)

  Metadata Properties

  •     ID- unique within parent container
  •     Kind-track user type ex:Joblisting, resume, etc.
  •     Version- update timestamp on each operation

  Flex Properties

  •      Can change instance type or add additional properties
  •      Support for simple types:decimal, string, bool, etc
  •     All properties are indexed.

 

When you add a property to an entity automatically searchable.

*Entity properties may differ in type and instance.

*Container stores flexible entities, Unique name within parent.

*Authority holds DNS name, unit or billing and geo-location, analog to namespace.

 

Web Service API (SOAP/REST)

Both supported, Endpoint secured by SSL

Each authority has single owner

Secured using single owner credetials

 

Operations

   Authority: Create Update and Delete

   Container provisioning

  Entity storage, update, delete, and query

  Query uses simple LINQ-like syntax

Exposes URI for each resource:

Service: https;//data.sitka.microsoft.com/v1CreateAuthority(post)

Authority: https://auth.data.sitka.microsoft.com/v1

   FetchAuthority (GET)

   QueryContainers(GET) with query

   CreateContainers(POST)

Container:

  DeleteContainer(DELETE)

  Create(POST)

 

So Sync Framework takes away the middle tier to a web service app. Write your front end with all your <%#Eval("INFO")%> from datasource = to url of sql server. Is that exactly safe?

Beta by invite only!

Live not available until first quarter 2009...  So is this just a service from Microsoft or a true add on to your own SQL Server?

Live will be pay per use. Wow this just went another direction. Hate paying for services.

To sign up for beta:

www.microsoft.com/sql/dataservices

http://blogs.msdn.com/ssds

nigel dot ellis at microsoft dot com

 

This looks like Microsoft's answer to Amazon S3 or Simple DB Services.

 

 

I have a ton of video from the keynote. However it is all grainy and well even Microsoft expressions is have a hard time with it. So I will try to get some better pictures. A couple of great apps that have been discovered:

cetwit- windows mobile twitter application

feedslide - One click application for turning rss feeds into jpegs for zune or ipod.

Images from the Luxor.

IMAGE_00084

IMAGE_00087

 IMAGE_00082

 

Had to add Yesterdays lunch.

IMAGE_00078 

 

Yes I twitter. Maybe too much.

ati.com/tags/web%20technologies" rel="tag">web technologies,,,,

I am a huge fan of Pablo Castro(the presenter).

IMAGE_00081

Astoria has become ADO.NET Data Services Framework.

Data in the web:

  • Ajax applications
  • Silverlight applications
  • Online Services
  • Mashups

Restful Interface for Data:

  • Just Http
  • Data as resources, HTTP methods to act on it.
  • Uniform URL syntax
  •   Every piece of info is addressable
  • Multiple representation
  •    Use regular HTTP content-type negotiation
  •    Atom, JSON, Plain XML

Book: Restful Web Services

Drill down data using Astoria(http request or get)

Model and Operation Semantics

  • Underlying data model
  •       Entity Data Model
  •       Entities -> Resources
  •      Associations -> Links
  • Operation semantics
  •       Usual mapping of HTTP methods
  •       Get -> retrieve resource
  •       Post -> create resource
  •       Put -> update resource
  •      Delete -> delete resource

URL Conventions

Addressing entities and sets

    Entity-set /Bookmarks

    Single entity /Bookmarks(123)

    Member access /Bookmarks(123)/Name

    Link Traversal  /Bookmarks(123)/Tags

    Deep access /Bookmarks(123)/Tags/('abc')

    Raw value access /Bookmarks(123)/Names/

Key words and syntax:

    $value get rid of (goo) xml or data tags

    $filter = Color eq Red  Get color red by filter Dollar signs so you don't use names?

    $orderby

     = or eq

    $paging

     $top

      $skip

       &

      $expand  (=has to be a link)

     /

     Format your data just using a http strings

Data Services

  •   Various data sources
  •      Entity Framework
  •      Linq providers

Model-driven

  •     Structural description in Entity Data Model
  •     Metadata shapes service

Create a linq provider use Astoria to turn it into service and you have http data access.

Set your rules in your class or web.config.

"config.SetEntitySetAccessRule("",EntitySetRights.All);"

Refining and Securing Services

  • Visibility

           Read, Query, and Write options.

  • Authentication
  • Interceptors

          Execute before HTTP GET/PUT/POST/DELETE

  • Service Operations

              Custom entry points /MyTags?startDate='2002-28-08'

Astoria is:

Ajax integrated

Silverlight supported

Astoria is the future of data mining!

   

 

 

 

 

 

 

 

 

 

 

 

Long name good times.

Topics:

  • Delivery mechanisms
  • Hands on encoding
  • Best practices

Goals:

  • Deliver content(compelling)
  • Maximize ROI for encoding.

Two most common audio/video delivery

  1. Progressive download
  2. Streaming real time without caching

Progessive download:

Pros:

  Easy management and config

Lower server resource usage

Supports Secure sockets Layer(SSL)

Firewalls

Cons:

No Live

No advanced

No buffer

Streaming Download:

Pros:

Basic and advanced media features

Bandwidth optimization

Enables Live broadcasting

Cons:

Requres management infrastructure

Cant deliver content encoded at a  higher bitrate than connection speed.

IIS7 Media Pack

  • Media delivery on top of IIS7
  •   Bit rate throttling
  • web server playlist
  • adds basic streaming
  • Free www.iis.net

Distribution services

Outsource

  • Silverlight.live.com
  • Content Delivery Networks
  • For Public consumption
  • Do it yourself server 2008

Using IIS7

  • Using Windows Media Services 2008
  • Very popular on internal networks
  • Push internally to CDN(outside/inside)

"Silverlight is the future of streaming on the web"

WMV ecosystem:

  • Mature live streaming
  • Big Ecosystem
  • intergration into major editing platforms

Why WMV and VC-1?

  •   Greater quality
  • Better decode performance
  •   up to 2x pixels/second of H.264
  • Large existing libraries of content

It is just windows media

  •   Most existing files urls work
  • Media features baked into runtime
  •   no OS codecs
  • Video codecs
  •   wmv7/8/9 9advanced profile
  • Audio codecs
  • windows media audio in silverlight1.0
  • windows media audio pro  new in silverlight 2
  • MP3 files also supported

Expression Encoder 2.0 Download Now

Selling points:

designers - deliver vision quickly

developers-Programmable object model

business-Faster encoding and lower bandwidth cost.

When encoding video in Microsoft Media Encoder: Turn off Clear type to make video smoother.

Best practices include:

  • Keeping bandwidth usage down
  • Clean video(no jumping or artifacts)
  • Clean Audio(no jumping or skipping)
  • Avoid analog to DV bridges

I encoded this during this session. =)

 

Applications interact with the outside world. mmm?

Mashups and such. ok

Many types of outside data....

  • Images
  • RSS
  • Business services
  • Intranet services
  • Mashup API's

silverlight1.1 xaml and fun

-no easy way to connect to other services.

What does client code look like?

Custom services.

Recommended uses of services in silverlight

Using silverlight front end connecting to webservice or database directly.

Using C#

void list<product>getproducts (string searchstring)

  1. Create service
  2. Define What does
  3. Add Service reference
  4. Use the service

Silverlight-Enabled WCF Service

  • ServiceContract
  • OperationContract
  • DataContract

Reference the service

var proxy = new ShoppingServiceClient() [service]

  • Default address chosen if no parameters given
  • canpass in addresss manually
  • but what if the service moves?
  • Config support after beta1

Only uses async methods

<GetProductsDataSource/>

migrate from silverlight1.1 on client side

  • Remove web references
  • do add service reference
  • Data format is now SOAP, not JSON

Server-side no need to change!

Using cookie or session data to pass authentication.

silverlight consumes web page authentication.

HttpContext.Current.User = current user

 

Pull in outside service

Add Service Reference

include:

  •   Services
  •   Soap
  •   Soap internet
  •   SQL Server Data services

WSDL connection... nice!

 

No cross domain applications!

mysite.com cannot call yoursite.com using the same authentication mysite.com.

you can hack it using the policy files:

  • silverlight policy file clientaccesspolicy.xml
  • adobe policy file crossdomain.xml

3rd party authentication using browser based authentication is looked down upon.

Allowed Urls Http and https subject to cross domain rules no ftp or file://URLs

Sockets support for non-HTTP Services:

-originating server only.

Download code:http://code.msdn.microsoft.com/silverlightws 

Restrictions:

  • No Put,Delete
  • Only get success of failure. No debugging? That's not so cool.
    • -403 and 404 will not be displayed.
  • Redirects:Work(may be blocked in cross-domain)
  • Cannot override the browser
  • Caching turned off
  • http authentication
  • read/write cookies.

Access to XML

  • XMLReader/XMLWriter
  • Ling to XML
  • Serialize/DeSerialize
  • Build Type

JSON Data Format usage

JavaScriptObjectNotation easy fast to parse.

  • Binary XML
  • Linq to JSON
  • load JSON strings

RSS/Atom feeds

Uses:

  • RSS 2.0
  • Atom1.0
  • Atom Publishing(future)

 

Looks promising but not fully cooked.

 

More Posts « Previous page - Next page »