In this section, we show how Restbucks has implemented a simple version of the fulfillment service using Windows Communication Foundation (WCF). WCF provides a service hosting runtime that takes care of some of the low-level plumbing, allowing us to concentrate on the overall design of our service. Since we tend to work in a rapid, test-driven manner, we’ve decoupled our service implementation from the WCF runtime. This enables us to deliver functionality quickly by specifying and testing specific HTTP interactions without having to start and stop a service instance.
Because the fulfillment protocol is built on top of AtomPub, our solution needs to implement AtomPub collection and member protocol resources. We’ll start by describing how we’ve built these collections and members using some of the .NET Framework’s syndication classes. After that, we’ll look at how to add domain logic that instantiates these classes in line with the fulfillment protocol. Next, we’ll look at the simple Test Driven Development–centric framework we use to decouple our service implementation from the WCF runtime. Last, we’ll examine the commands that we use to handle requests.
As we mentioned in Chapter 7, the .NET Framework’s
namespace contains a number of classes that can be used to implement
feeds and entries. For example, by adding a list of
SyndicationItem objects to a
SyndicationFeed and then outputting ...