The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








I heart FeedBurner

Latest Diggs - Programming

Computers Blogs - Blog Top Sites

Site Hits

Total: 4,904,481
since: 19 Jan 2005

Silverlight 3 Out-of-Browser Apps vs. Live Framework Mesh-Enabled Web Applications

posted Tue 24 Mar 09

In case you're not all that familiar with the Live Framework, a MEWA is a Mesh-Enabled Web Application. What that really means is a Silverlight (currently v2.0 only) application that is actually installed in your Mesh. When I say "installed", what I mean is that the Silverlight application is actually a Mesh Object and the XAP file is actually an attachment to one of the entry items in that mesh object. This is all a bunch of technical hooey that boils down to the idea that a MEWA is a Silverlight application that follows you whereever you go. It will install itself onto the desktop of any machine in your mesh and can be run from the Mesh portal website if you're on the go or at a coffee shop or library, etc. Support for running these MEWAs from Windows Mobile is also in the works.

It is important to note that the MEWA stuff was available in CTP form for quite some time before Silverlight 3 was unveiled to the public with it's support for Out-of-Browser installation. So what are the key differences between a MEWA that was installed on your desktop by the Mesh and a Silverlight 3 application that you took offline by interacting with it?

Data

The Live Framework is all about data synchronization; making sure that no matter what you're doing or where you are running an application, your data follows you. Internally this is done by having all of the data in the mesh synchronize bi-directionally using the FeedSync protocol and the Atom Publishing Protocol (APP). The primary means by which a MEWA stores its data is by creating and manipulating entries in the various feeds that belong to its Mesh Object. This allows data changes made on your computer to automatically synchronize throughout your mesh so that the data is available to all other instances of that application (and potentially other applications as well). MEWAs also have access to Isolated Storage and can of course consume Web Services (provided the server has a valid cross-domain policy XML file because MEWAs do not have a site-of-origin domain that you can count on..they come from the Mesh).

A Silverlight 3 application was, at one point or another, accessed from someone's Web Site. Whether that site is hosted by Azure or by your corporation or by some third party hosting company is irrelevant. To bring the application offline, the user either right-clicked the SL3 app and chose "Install" or clicked a button in the app to take it offline. Once offline, the SL3 application can access traditional Web Services, can receive "Data Push" messages from it's site of origin, and can access Isolated Storage. It's worth keeping in mind that the SL3 application has a 25MB Iso Store quota whereas the MEWA only has 1MB. SL3 also has access to .NET RIA Services, which allow for multi-tier spreading of common models and business logic to abstract on top of Web Service calls.

In theory, you could have an offline SL3 application use the Local MOE to talk to the Mesh, but I won't get into that ;)

Summary:
   SL3 - IsoStore, Web Services, .NET RIA Services
   MEWA - IsoStore, Web Services, Mesh Objects/Feeds

Automatic Updates

When a new version of a MEWA is published to the Live Mesh by the application author it is then run through an approval pipeline. Once it comes out the other side of this pipeline, it is published on the Live Mesh and optionally made available in the Mesh's central Application Gallery. As soon as this publication occurs and you connect your computer with a Mesh that has an old version of this application, the new version of the application will be synchronized down to your machine. This happens for all your connected devices and the cloud-based Mesh portal will also get a new version of the MEWA. Upgrades to a MEWA application can often cause problems with existing data already in the Mesh feeds so the developer needs to be constantly aware of accessing "old" mesh data.

As the application author of an SL3 application, you publish a new version of this application onto your web site. The next time anyone runs their offline browser application, it will asynchronously check for new updates. Once found, the application can respond to this and notify the user that new updates have been downloaded. After a restart, the SL3 application will be updated to the new version.

Summary:
    MEWA - Passive feed-based synchronization of new application bundle
    SL3 - Automated poll of site of origin for new updates, can respond to "updates downloaded" event to notify user.

Network Connectivity

Mesh-Enabled Web Applications are synchronized to your Live Desktop and to all of your mesh-connected devices automatically by the Live Framework itself. As a result, MEWAs have the ability to access the Mesh URLs because those all have valid cross-domain policy files, but there is no real "site of origin" to speak of since the applications call from from "the mesh".

Silverlight 3 Out-of-Browser applications at some point begin their lives as traditional web-hosted Silverlight applications and as such have a known site-of-origin. They can access any network resources on both the origin site and any other site with a valid cross-domain policy XML file.

Summary:
    MEWA - Can access any site with a valid cross-domain policy file
    SL3 OOB - Site of origin automatically, plus any sites with cross-domain policy files.

Location on Disk

MEWAs are currently stored on your computer in a cryptic, semi-hidden location that involves a lot of directories with names that look like GUIDs. MEWAs are launched by a custom live framework chrome container that hosts the HTML necessary to launch a Silverlight application.

Silverlight 3 Out-of-Browser applications are launched by invoking the sllauncher.exe application with a parameter that usually looks something like localhost.0 which is a unique ID that is used to look up the downloaded XAP file. Also don't forget that Silverlight 3 applications have the ability to open files on your hard drive via an "Open File" dialog (returns a Stream for security reasons) as well as save files to disk using the same mechanism. These files are not managed by quotas as they reside wherever the user wants them to be. This is a very powerful new addition and creates some very exciting possibilities for file-based SL3 applications.

Summary:
  
MEWA - Custom chrome container that launches the Mesh Object by reading it from the Local MOE
   SL3 OOB - Custom chrome container that launches the Silverlight 3 application by ID lookup into local cache

Should I Be Building a MEWA or an OOB SL3 App?

The bottom line really boils down to where the vast majority of your data is and how much infrastructure you plan to have. MEWAs are nice because if you write your application to exclusively use the Live Framework feeds for its data then you don't ever need to host your own website - everything is stored locally and then synchronized by the Live Framework. The downside is that MEWAs only synchronize within a single mesh, so to expand the reach of your application people need to invite other people to share the application data. This may or may not be exactly what you're looking for - but you will probably know immediately whether this is a model you want to support or embrace.

Silverlight 3 Out-of-Browser applications feel more like a Silverlight enhancement to the original concept of ClickOnce. You have a website (could be hosted by Azure, a third party, your own data center, etc) from which people access your Silverlight application. If they want, they can install an out-of-browser version of that application and run it offline. When running OOB, they can access data locally (IsoStore) or remotely (site of origin or other "trusted" (policy XML) sites.

Summary:
    MEWA - Isolated smallish groups of app instances sharing data via synchronization
    Silverlight 3 OOB - Central infrastructure w/ ability to run apps offline and store data locally

I think the real take-away here should be that MEWAs and Out-of-Browser Silverlight 3 applications are really designed to solve two entirely different problems. Right now there is some overlap in intent and in implementation and I'm hoping that in the near future you'll be able to build Silverlight 3-based MEWAs. In the end it really boils down to your infrastructure and what your application plans to do with it's data that will steer you toward MEWAs or toward SL3 OOBs. Now get coding!

Stay tuned for more posts related to SL3 and all the extremely exciting new stuff that comes along with it.

tags:            

links: digg this    del.icio.us    technorati    reddit

AddThis Social Bookmark Button




Tag Related Posts

What's New in Silverlight 3

Fri 20 Mar 09 2:38 P GMT-05

Live Framework April 2009 CTP is out!

Fri 13 Mar 09 12:11 P GMT-05

Live Mesh Tutorial 1 - Hello Live Mesh

Thu 06 Nov 08 2:33 P GMT-05

The Evolution of the Cloud - Then and Now

Mon 06 Oct 08 12:34 P GMT-05

Microsoft's Lofty Direction

Sun 05 Oct 08 2:30 P GMT-05

MobileMe vs. Live Mesh Throwdown - Round 1

Wed 16 Jul 08 10:33 A GMT-05

MobileMe vs. Live Mesh - Round 1

Wed 11 Jun 08 12:20 A GMT-05

My Silverlight Plugin has expired - WTF?!?

Thu 08 Nov 07 7:34 P GMT-05
tags:    

Silverlight 1.1 Alpha Refresh

Fri 10 Aug 07 2:09 P GMT-05
tags:    

My Appearance in the RIA Shootout on sys-con.tv

Tue 05 Jun 07 11:41 A GMT-05
tags:              

Silverlight and Astoria - First Impressions

Mon 04 Jun 07 1:40 A GMT-05
tags:    

I'm going to be on TV (sort of)

Sat 02 Jun 07 12:19 P GMT-05
tags:              

Silverlight Revisited

Sat 21 Apr 07 9:48 P GMT-05
tags:    

Will Silverlight be DOA?

Mon 16 Apr 07 8:02 P GMT-05