I started this application the first day I joined to Tellago’s team as an exploratory example of REST and the state of the art of the web frameworks in .Net. The idea was always to make it opensource and today is D day.
This is the result of a collaborative effort, even if I wrote almost all the code; I did it with the guidance of the amazing group of experts working at Tellago.
The example has served me to learn the REST theory as well as the new Wcf Web API. It has also served to the team to discuss various different approaches and to explore different technologies.
The purpose of the example is not to show “THE” way of doing things but to have a sample application that we can use to brainstorm, discuss and illustrate some RESTful patterns and best practices using the WCF web APIs. Consider this as one way of doing REST on the .Net platform.
My plan is to keep growing this example as well as write a complete series of blogposts on how I implemented the use cases.
As any opensource project, contributions are welcome :) . Feel free to clone this repository to do from small changes to a huge changes like completely replacing a library or such.
Briefly, RestBucks is a traditional American coffee shop that has some very specific characteristics. They offer a tasty coffee and, what is most interesting for us, a RESTful interface by which customers can place and manage their coffee orders. With this REST interface, customers can make an order, customize, cancel, check the status among other tasks. If you want to read a more (but not the whole book) you can read this article in infoq (I strongly recommend the book though).
These are the use cases implemented so far:
- The customer makes an order
- The customer changes an order
- The customer pays the order
- The customer queries his order
- The customer cancels his order
As well, as:
- The barista prepare an order
Since I started to participate in the opensource world with examples, I always tried to avoid examples that doesn’t work in real life or to answer to a poignant question with “it is just an example”. My goal with this application is that you can take it and use it for a real world scenario. Thus I am using real world technology, patterns and methodologies:
- A relational database to persist the data.
- An Inversion of control container
- An Object to relational mapper
- Test Driven Development.
- Future articles will discuss other well-known RESTful services patterns.
The tools I have used for this example were not randomly chosen. They are ready to be used in real world applications.
All the information of this post, is in the codeplex documentation site, always refer there to get the latest version. I wrote two more sections in the documentation for now:
I hope you find this useful and enjoy the series.