Sunday, November 27, 2011

Cocoon – A new framework for Windows 8 Development

Regular followers of my blog will know that over the last year I have been discussing a framework that I introduced for Windows Phone 7 development named Chrysalis (http://chrysalis.codeplex.com/). Whilst not a Model-View-ViewModel (MVVM) framework itself, allowing the use of your preferred framework for this purpose, it was designed to enable view models to interact with the phone lifecycle and hardware in a simple and natural manner.

Following the announcement of the Windows 8 Metro-style application programming model at Microsoft’s //build conference, it became clear that many of the same challenges would present themselves for Windows 8 applications.

The Cocoon Framework

To assist with Windows 8 Metro-style applications I would like to announce the Cocoon framework (http://cocoon.codeplex.com/). This aims to build on top of the learning from the Chrysalis project to provide a simple way to develop Metro-style applications in a manner that fits naturally with the MVVM design pattern.

It is likely that many Metro-style apps will be connected applications, downloading data from across the internet in response to user navigation. Modern applications are expected to do this in a seamless manner, retrieving data on demand and populating the user interface in response. In some ways this is at odds with the web API programming model that is based upon individual request-response calls, with paging used to retrieve large datasets. One of the first targets of the Cocoon framework is to simplify this process – bridging the world of stateless web API calls, with the “fast and fluid” interfaces expected by users.

Cocoon Framework Development

Since Windows 8 is currently at an early stage, it is anticipated that the Cocoon framework will evolve alongside further releases. If functionality is introduced in the platform that duplicates that within the Cocoon framework, efforts will be made to migrate to the platform support whenever possible.

It is an exciting time for Windows developers, with the upcoming release of Windows 8 ushering in a new ecosystem of applications. The Cocoon framework will allow you to focus on your individual business logic, whilst ensuring that the user experience fully supports the richness of the platform.

Summary

To conclude, the first source-code drops of the Cocoon framework are freely available on CodePlex (http://cocoon.codeplex.com/). As the project evolves, new functionality will be explained on this blog so stay tuned.

4 comments:

Anonymous said...

Hi Andy, Okra kinda looks promising for WinRT LoB apps. Please help me better understand it: is is a replacement for Caliburn Micro? Or do we use it with Caliburn Micro?
Thanks a lot.
(Sorry I do not have any of the IDs available to sign in)

Unknown said...

In general Okra replaces the functions of Caliburn Micro. In particular the view/VM discovery and navigation support is specifically designed for the Win8 application model.

However, Okra is designed to work with any base class types so if you have a current solution that uses PropertyChangedBase, commands, the event aggregator, etc. from Caliburn Micro then you can still use them in combination.

Andy

Anonymous said...

Thank you, that confirms what I understood. Caliburn tries to 'do it' for a number of platforms while Okra is specific to WinRT (right?).
I would then assume that Okra is more 'straightforward'/less 'complex'. In your opinion is there any functionality that Caliburn provides that Okra does not (besides support for other platforms than WinRT)? I'm seriously considering Okra for my LoB app. Thank you for your time.

Unknown said...

That is a good summary... Okra is specific to WinRT (more specifically .Net Windows store apps) so designed without the constraints of supporting multiple platforms. The advantage is that Okra can 'understand' Windows 8 concepts such as application activation, suspension, the various charms etc.

There is definitely a lot of functionality that Caliburn Micro contains that Okra does not - actions & the event aggregator are two that come to mind. Personally I prefer a light-weight MVVM implementation (simple NotifyPropertyChangedBase & ICommands) and this is included with Okra. One possible option is to use Okra & Caliburn Micro in one app - I haven't tried this but it is something I'm thinking of investigating in the future - Caliburn for the advanced MVVM features with Okra for the Win8 knowledge.

Andy