Live Services: What I Learned Building My First Mesh Application Don Gillett Principal Architect Microsoft Corporation BB41
Dec 25, 2015
Live Services: What I Learned Building My First Mesh Application
Don GillettPrincipal ArchitectMicrosoft Corporation
BB41
Mesh Application OverviewJotDemoKey Takeaways and TipsCode walkthroughQ & A
Agenda
Azure™ Services Platform
Azure™ Services Platform
Mesh ApplicationsSynchronized access to your shared data
desktop
phoneserver
Simple note taking and list creation Notes and lists can be shared between people
and across devices. Developed Jot as both a Mesh Application and
a ‘Mesh Enabled’ Desktop Application Key Scenarios
Shopping Lists Weekend To-do Lists Gift List Expense List “Digital Junk Drawer”
Jot
Jot
demo
Live Framework delivers another great component for .NET developers… it just fits in and getting started is simple.
A synchronized data store is at the heart of Mesh and it’s easy to utilize.
Mesh Applications work great with Silverlight. Mesh + Silverlight makes an excellent rapid development platform.
Compile your projects for both Silverlight and the full .NET runtime (desktop apps and services).
Best part... what I didn't have to do. User management, authentication, invites, contacts, permissions, ...
Key Takeaways
Getting Started With The Live Framework Librariesusing Microsoft.LiveFX.Client;
Mesh mesh = ConnectToMesh();
foreach (MeshObject meshObject in mesh.MeshObjects.Entries){
Console.WriteLine("MeshObject:\t{0} (type {1})",meshObject.Resource.Title,meshObject.Resource.Type);
foreach (DataFeed dataFeed in meshObject.DataFeeds.Entries){
Console.WriteLine(" DataFeed:\t{0} (type {1})",dataFeed.Resource.Title,dataFeed.Resource.Type);
foreach (DataEntry dataEntry in dataFeed.DataEntries.Entries)
{Console.WriteLine(" DataEntry:\t{0} (type {1})",dataEntry.Resource.Title,dataEntry.Resource.Type);
}}
}
MeshObjects, DataFeeds, DataEntries, and Enclosures make up the Mesh storage hierarchy…
MeshObjects are our top level containers MeshObjects represent the unit you want
to share. Live Folders creates one MeshObject for each
top level Live Folder that is created. Jot also creates one MeshObject for each Jot list.
Storing Data In The MeshCreating a 'Storage Model'
MeshObjects can contain 1 or more DataFeeds. DataFeeds represents a collection of data you want to
access and group together DataEntries
Represents your smallest storage units and can contain small chunks of application data directly within the DataFeed
Enclosures Enclosures are used when your chunks of data get
too big. They are stored in the Mesh and referenced from
a DataEntry.
Storing data in the Mesh Creating a 'Storage Model' (continued)
Live Framework Resource Model
Devices
Media Resources
Data Entry
Members Mappings Data Feeds News Subscription
Applications News Notification Queue
Mesh Objects
Scripts ProfilesMesh Contacts
LOEEnd-Point
Data Entry
Evolve from flat serialization or database storage to a merge-able storage schema using DataEntries
Step 0 - We’ll start with an application that knows how to persist to a database or flat file.
Step 1 - Reading and writing DataEntries from a DataFeed rather than directly serializing or loading from a database.
Step 2 – Utilize FeedSync. With FeedSync integration we can easily batch our changes, as well as easily accept changes made from other devices and users.
Storing Data In The MeshThe Code
Synchronization of data makes a good system of change notification all that more important. INotifyCollectionChanged and
INotifyPropertyChanged facilitate Silverlight and WPF data binding
ObservableCollection<T> implements INotifyCollectionChanged
One major gotcha is that notifications going to UI need to happen on the UI thread.
Code WalkthroughSilverlight and WPF data binding
(Try these search terms some good articles about getting change notifications to the UI thread for Silverlight and WPF.)
Mow the grassBuy giftsCall home
Code Walkthrough Object Model
Checklist
ChecklistItem
ChecklistItem
ChecklistItem
ChecklistItemData
ChecklistItemData
ChecklistItemData
Checklist Application
code walkthrough
Membership based on Windows Live ID Authentication Sharing Permissions and Invites Contacts News Feeds Application Distribution …
The Things Live Framework Gives Me Beyond Storage
Cross Development Between Silverlight And .NET (Desktop And Services)
Usefull (Invaluable) Tools
Fiddler 2Download from http://fiddlertool.com
Resource Model BrowserComes with the Live Framework SDK
Fiddler TipHow to substitute/debug any file on the web without uploading it
static function OnBeforeResponse(oSession: Session){
if (oSession.uriContains("myapp.xap")) {
oSession["ui-color"]="red";oSession["ui-italic"]="true";oSession.LoadResponseFromFile(
"C:\\myapp\\bin\\debug\\myapp.xap");oSession.oResponse.headers.Add("Vary", "*");
}…
Evals & Recordings
Please fill
out your
evaluation for
this session at:
This session will be available as a recording at:
www.microsoftpdc.com
Please use the microphones provided
Q&A
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.