“It’s a Knockout” – a phrase often heard at boxing matches. Or for those who remember 70’s and 80’s European TV shows, it was the name of a BBC television game show (It’s a Knockout or Jeux Sans Frontiers), also memorialized in the Peter Gabriel song “Games without Frontiers”.
There are two goals in this series of blogs – to provide information for readers who want to use the knockout framework in their web applications, and more specifically to describe how DotNetNuke is using knockout to build Single-Page-Application style modules.
Knockout was created by Steve Sanderson – who works for Microsoft on the Azure Platform and Tools Team – and who just happens to live in Bristol, where I grew up – not that that has anything to do with why I like it.
Developers who have done any work in Silverlight or for Windows Phone will be familiar with (or at least aware of ) the pattern as it is quite often used on those platforms.
The pattern was developed within Microsoft for XAML applications and is a variation of the “Presentation Model” pattern optimized to leverage some of the core capabilities of Silverlight and WPF such as 2-way data-binding, commands and behaviors.
MVVM – stands for “Model – View – View Model”
- Model – the domain model or business logic of the application
- View – the UI and UI specific logic
- View Model – manages the Presentation logic and state
The View Model sits between the domain model and the View in much the same way as the Controller in MVC or the Presenter in MVP, such that the View should know nothing about the Model and vice-versa.
In the next post I will introduce the knockout framework itself and show how it allows developers to implement the MVVM pattern.