This post is part of my PDC09 Conference Notes series. These are my raw notes taken while watching the various session videos from PDC09. Refer to my original post for some conventions I tried to use.
FT12 -WCF Data Services: What's new the RESTful data services framework (Pablo Castro)
- Name changed from ADO.Net Data Services to WCF Data Services
- REST
- REST is not a Protocol, standard, or Format
- REST is an architectural style
- Decoupling
- Scalability
- Layering
- Interesting way of defining REST. I always thought of it as some type of standard based on HTTP (verbs).
- Resources
- Represents the state of each of the entities your are modeling
- These resources (state) are the only thing that is viewable from the outside. There is no behavior.
- Each resource has an address. In this case, it's the URL
- Uniform Interface: Removes ambiguity of calls by constrain a system to a know interface.
- In REST, you have GET, PUT, DELETE and POST. You do not have ApproveOrder, VerifyCreditCard, etc.
- Date Service is not a gateway to the database
- There is almost always some type of business logic between the service and the data store
- I think that this business logic is a subset of what you might find in a Line of Business app, with additional logic as required in order to properly expose via a service.
- The business logic could be responsible for security, and performance considerations (i.e. don't allow something that will do a SELECT * FROM Table, where table has millions of rows).
- Open Data Protocol (Astoria => Ado.Net DS => WCF Data services)
- RESTful over http
- Poke-able (just open a browser and type a URL and see what comes back)
- HTTP: Transport, interaction model, control information in headers
- AtomPub: Format, introduces things like collections and links.
- Team added extensions to AtomPub as needed
- Introduced a json serialization option, which is useful when consuming from javascript.
- URL
- The URL is independent of the format of the data returned (json, atom, etc). So you can pass the URL around and it will not impact the format. The format is defined in the GET request (accept: applicat/json).
- Extra stuff goes in query string (?). Use & to append, just like normal query string.
- (#): Query by primary key. /Categories(6)/Products would return all products for Category 6
- Filter strings: ?#filter=Color eq 'Red'
- Return first x rows: $top=#
- Sorting: $orderby=ColumnName
- Eger Load: $expand=ChildCollectionName
- Only get certain columns: $select=Column1,Column2
- Where used
- .Net
- Sharepoint 2010 (install/enable Astoria?, and then you can access all sharepoint data from /vti_bin/listdata.svc/ListName). There is full business logic running, so it will check for authentication, update everything as necessary when you update the actual data.
- Reporting Services
- Azure Table Storage
- Codename "Dallas"
- Microsoft Media Room
- Open Government data initiative
- 3rd Parties
- IBM WebSpehere Extreme Scale
- Db4o
- Telerik Open Access
- LinqPad
- VS Support
- Add Service Reference now supports consuming data from the Open Data Protocol (needs to expose meta data)
- You'll get a data context type after adding the service reference
- Do something like: MyDataContextType svc = new MyDataContextType(URL), and then you can drill down into svc to access the various collections of entities that are exposed. Has support for adding (method), and I'm assuming updating as well.
- Full support for linq.
- It would be interesting to view the SQL being generated behind the scenes using Query Analyzer
- You can view the service as a diagram and get a schema diagram.
- Excel 2010 with Power Pivot
- Import a data feed using just the URL from WCF Data Services
- And then you can just work with it in Excel
- Works with the open data access for SharePoint as well.
- Latest version of SSRS (must be SQL 2008 R2)
- Every report has it's data exposed via this open data protocol.
- Browse to the report, the new report viewer has a button that allows you to export as feed.