Programming Windows Live Framework
This post continues my overview post about LiveMesh and the Windows Live Framework (http://www.12qw.ch/?p=13).
It explains how and why the Live Framework is interesting for software developers and what you need if you want to start programming Live Services.
1. Get a Windows LiveID (If you do not have one already)
2. Visit http://dev.live.com/liveframework/
3. Download and install the Live Framework SDK
4. Download and install the Live Framework Tools for Visual Studio
5. Go to the Azure Developer Portal (https://lx.azure.microsoft.com) and create a new application (select Live Services CTP and Mesh-enabled Web application)
6. Start Visual Studio
If you create a new application of type Mesh-enabled Web Application (MEWA) in Visual Studio, a wizard will guide you through the steps required to establish a trust relationship between your Visual Studio and your cloud project created on the Azure Developer Portal.
There are 3 different types of applications that can be developed using the Live Framework:
1. Live Framework-enabled Web Sites
2. Live Framework-enabled Rich Clients
3. Mesh-Enabled Web Applications (MEWA)
Type 1 & 2 are very straightforward. You can enhance an existing Web or Rich Client Application by connecting to the users Mesh. There, you can access different MeshObjects, such as applications, contacts, news, etc.
The really big deal comes in the form of Mesh-enabled Web Applications (MEWA). MEWA are applications that run in the Cloud. But, as soon as you create an application instance, it will be automatically synchronized to all the devices in your Live Mesh. The application is automatically installed on your synchronized local devices.
MEWAs are the ultimate combination of the best features found in web-applications and rich-clients. The very same application instance is available online and offline and user data is synchronized between all running instances.
The Live Operating Environment (LOE)
The Live Operating Environment is the endpoint used by the application to communicate with the cloud. The key is that the LOE will be replicated onto every local device added to the users LiveMesh.
This is THE essential feature which makes programming Live Services so interesting.
A MEWA running locally on a client device will always talk to the local instance of the LOE. The Framework will transparently synchronize a subset of the data from the cloud LOE in the background.
A MEWA running in the web, for example on the users Live Desktop, will connect directly to the cloud LOE.
Picture 3: Different runtime scenarios for a MEWA
On picture 3 you can see different runtime scenarios for a Mesh-enabled Web Application (MEWA). Red colors depict developer code whereas blue colors depict framework code.
It is important to mention that the three applications in the picture are not only the same application but the very same application instance. The Framework will take care of all the synchronization and caching issues.
The Live Framework Resource Model
The Live Framework provides a resource model that is based on entities, collections of entities and their relationships. The framework model is REST based, meaning every resource can be addressed by a unique URI. Relations between resources are represented through hyperlinks.
Picture 4: The Live Framework Resource Model
The most important entity in the resource model is the Mesh Object. The mesh object is basically a container for data. It has several properties that define its behavior in regard to sharing, synchronization and data.
Picture 5: Components of a Mesh Object
Each Mesh Object has the following properties:
· A collection of mappings to devices: As soon as a certain device is added to this collection, the Framework will synchronize the MeshObject to that device.
· A collection for mappings to users: As soon as a Windows Live user is added to the collection, the MeshObject will be shared with that user.
· A collection of news: Every change in the MeshObject’s data is reflected in a news notification.
· A collection of datafeeds: DataFeeds are the generic abstraction of a collection of DataItems. This is where an application can store its data.
Note that an application instance is a MeshObject as well. Thus, the same rules for synchronization, sharing or notification will apply.
Live Mesh Beta:
Live Framework CTP:
Windows Azure Developer Portal:
The Live Framework MSDN Forums: