oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

Creating an Application from Scratch, Part 1
Pages: 1, 2, 3

The Windows Application

The second module is a Windows application (eventually a Windows Service) that connects to the Amazon Web Service periodically (e.g., every hour) and finds every review you've written to date. It records the book (ISBN, author, genre, etc.) and your rating (how many stars). It updates the database (initially, it just chucks all the old records and creates new ones, but pretty quickly we'll find existing records and update them).

It then asks Amazon for the identification of everyone else who has reviewed the books you have reviewed, and it creates a record for them, keeping track of how many stars they gave each book you reviewed.

The Windows application will then compute (and store in the database) a "match rating" for each person in the database, initially based on the criteria shown in Table 1.

Notes: The first column is how closely you matched the reviewer. An exact match is that you both rated the book with the same number of stars. The second column is how many "match points" the reviewer is awarded to indicate how closely that reviewer matches your taste. Columns 3 and 4 provide an example of how such a match might be accomplished. For example, the fourth entry ("Off by 3") indicates that the reviewer might get the associated match score (-5) if you rated a book with two stars and the reviewer gave it five stars. Of course, this could also happen if you rated the book with four stars but the reviewer only gave it one.

Match Points Example: You Rated Example: They Rated
Exact 5 4 stars 4 stars
Off by 1 3 4 stars 3 or 5 stars
Off by 2 -3 3 stars 1 or 5 stars
Off by 3 -5 2 stars 5 stars
Off by 4 - 10 1 star 5 stars

Table 1. The Match Points table

Each reviewer will have an individual entry in the reviewers table with their match score. The score will be (initially) just the average of the match points awarded for all the books you've both reviewed. In a later version we'll be able to define match criteria in a more sophisticated way; for example, taking into consideration the standard deviation or whatever other fancy statistical basis will give us the most confidence.

The next step is to query the Amazon Web Service for all the other reviews by each reviewer. That is, we want to know how each reviewer rated every book they reviewed that you have not reviewed (these are potential recommendations). For each book reviewed, we'll record the ISBN, title, genre and any other relevant information, including--most importantly--the rating this reviewer awarded the book.

The resulting database will provide the data used by the ASP.NET application to display results or recommendations to the user.

Enhancing the Search

There are all sorts of ways to enhance the user experience, both by improving the sorting of recommendations and by providing sophisticated search opportunities. You might, for example, want to sort in various ways, including:

  • Sort results by best-matched reviewers.
  • Sort results by best-rated books.
  • Search results by genre, author, or other criteria.

In addition, rather than just receiving recommendations, you might request specific searches:

  • Find every Stephen King book liked by people who like the books I like.
  • Find every Stephen King book by people who like the Stephen King books I like.
  • Find all the books that were highly rated by people who like the same Stephen King books I like.
  • Find all the Orson Scott Card books by people who liked the science fiction authors that I like.
  • Show me the average score (and some reviews) of this particular book, by people who like the fiction I like.

The possibilities are endless, and I'm sure you can imagine many more queries. For example: "Show me every science fiction book that is highly rated by people who 'agree' with me about Neuromancer and Ender's Game."

Pages: 1, 2, 3

Next Pagearrow