Correspondence launch

image

Download the project from Codeplex.

Correspondence is a library for building occasionally connected client applications. In other words, an app that can tolerate being off line. These have typically been hard to write. Correspondence makes it easier. It gives you the following features:

  • Client-side storage
  • Server-side storage
  • Client-server communication
  • Client-to-client collaboration

And because it’s based on Update Controls, you also get:

  • Automatic dependency management
  • UI update notification
  • MVVM support

So imagine that you and a friend are using the same application. They make a change. Your UI is updated. That’s what Correspondence does.

The Factual modeling language
To get all of these features, you have to model your data differently. You declare your model using a language called Factual. Here’s a snippet of Factual describing players and moves in a Reversi game:

fact Player {
    pivot User user;
    pivot Game game;
    int index;

    Move* moves {
        Move m : m.player = this
    }

    bool isActive {
        not exists Outcome o : o.game = this.game
    }
}

fact Move {
    Player player;
    int index;
    int square;
}

The model is neither relational, nor object oriented. It is historical. It defines historical facts. These facts have fields, relationships, queries, and predicates. All of that is defined in the model so that Correspondence can generate the storage and communications for you.

The development tools

When you get the Correspondence bits, you will pull down two installs. The first is for your development machine. It installs:

  • The library assemblies
  • The Factual compiler
  • Project templates

Once you install this component, you’ll want to go into Visual Studio and hit “File”, “New”, “Visual C#”, “Correspondence”, “Correspondence Model”. This will create a project that references the right assemblies, and has a T4 template that runs the Factual compiler. Using the other project templates, you can create view models, unit tests, and WPF applications that use that model.

SyncExpress

The second install is for your server. It installs a Windows service called “Correspondence SyncExpress”. It runs on http://localhost:9119/SyncExpress. Point your clients at that service and they will synchronize.

SyncExpress is licensed for development and test environments. It is not intended for production. I’m working on some production-ready options for you. For now, just use it to experiment with Correspondence.

Examples

If you download the source from Codeplex, you will find a Reversi game. Edit the app.config to point the client at your installation of SyncExpress, and you can play a game with a friend.

I am also writing lessons on the Codeplex site taking you step-by-step through building your own Correspondence application. Eventually, I will record screen cast videos of that content.

Please download the bits and follow along with the lessons. I think you’ll find that creating occasionally connected clients has gotten much easier.

Leave a Reply

You must be logged in to post a comment.