Correspondence code cadence

As a follow up to the demonstration of Correspondence on Windows Phone 7, I’ve added a feature to the Reversi app. This demonstrates the cadence of coding with Correspondence.

The cadence is:

  • Fact
  • Community
  • Query
  • View Model

First, you define a fact in the model. A fact represents an action taken by a user. It is a fact that a player sent a message in a game.

Second, you add that fact to the community. When the user presses “Send”, call Community.AddFact(new Message()).

Third, you write a query in a related fact. Query a game for all of the messages.

Fourth, you expose that query through the view model. Data bind to the collection of messages.

Watch this video for an example of that code cadence as I add the chat feature to Reversi, both in WPF and in Windows Phone 7.

Coding Correspondence on WP7 and WPF from Michael L Perry on Vimeo.

Bonus question: what step is usually part of a client\server application that you do not see in this cadence?

Leave a Reply

You must be logged in to post a comment.