AdventureWorks2012 OData service sample - Introduction
This post introduces the AdventureWorks2012 OData service sample. This is our second sample that uses an agile approach to develop and deliver samples. During our first agile samples project, I learned how to write more concise user stories as follows:
As a (persona) I want to (feature) so that (benefit)
This sample will follow this pattern. Before writing any code, I wrote the sample themes and user stories.
AdventureWorks2012 OData service sample themes
- As an IT Administrator, I want to expose a selection of AdventureWorks2012 views as an OData service so that internal teams, vendors, or our customers can view selected AdventureWorks2012 resources from any device.
- As a developer, I want to consume the AdventureWorks2012 ProductCatalog resource so that a Usability Designer can bind to a user interface to create an application.
- As a Usability Designer, I want to create a customer-facing product catalog application so that our customers can view our products from a device.
From these themes, I created eight user stories that will be delivered in six iterations. The final sample will be an MVVM application that pulls together each user story. One advantage of an agile project is that you do not need to have a complete design before starting. With that said, I have only written the SQL views that will be used as OData resources. By providing feedback on this blog, or sending me an email, you can help define any part of the sample. My email address is derrickv@microsoft.com.
AdventureWorks2012 OData User Stories
1. As an IT Administrator, I want to only allow views of the AdventureWorks2012 database to be exposed as an OData public view so that the information about the AdventureWorks2012 schema is not compromised. |
Iteration 1: AdventureWorks2012 Views · Production.vProductCatalog · Production.vManufacturingInstructions · Production.vWorkOrderRouting · Sales.vCompanySales · Sales.vTerritorySalesDrilldown · Production.vDocument |
2. As a Developer, I want to create a WCF 5.0 service that exposes views approved and set up by central IT so that developers can consume the OData service resources. |
Iteration 1: How to create a WCF Data Services 5.0 service exposing resources from specific AdventureWorks2012views. Run the AdventureWorks2012 service from localhost. |
3. As an IT Administrator, I want to publish the AdventureWorks2012 product catalog view as a WCF 5.0 service so that any OData application can consume the feed. |
Iteration 2: How to publish the AdventureWorks2012 OData service. |
4. As a Developer, I want to create an asynchronous model that maps to the ProductCatalog OData resource so that the model can make asynchronous calls to a live OData feed. |
Iteration 2: Asynchronous ProductCatalog model as a set of Unit Tests published to CodePlex. |
5. As a Developer, I want to create a ProductCatalog view model so that other developers can bind device views to the view model. |
Iteration 3: ProductCatalog view model as a set of Unit Tests published to CodePlex. |
6. As an IT Administrator, I want to set up appropriate permissions on the AW database so that sensitive data will not be exposed as an OData feed. |
Iteration 4: How to set up appropriate OData feed permissions. |
7. As an IT Administrator, I want guidance on best practices to expose our database as an OData feed so that our database is secure and the service is relevant and easy to consume. |
Iteration 4: General guidance on how to expose a database as an OData feed. |
8. As a Usability Designer, I want to create a device view (device TBD) that binds to the ProductCatalog view model so that our customers can view the product catalog from a device (device TBD). |
Iteration 5: A sample device view that binds to the ProductCatalog view model such as a Windows 8 app or HTML 5 Office 2013 app published to CodePlex. |
I created a step diagram to illustrate each iteration:
The AdventureWorks2012 OData views are complete and will be provided in iteration 1. Iteration 1 will be available in about a week. For now, I have attached the SQL script to create the views on AdventureWorks2012. You can download AdventureWorks2012 at https://msftdbprodsamples.codeplex.com/releases/view/55330.
Your feedback is appreciated,
Derrick