Tuesday, October 30, 2012


Github example to come on using knockout, upshot, nodejs, and mongo to build a demo spa.

Upshot is powerful DAL (Data Access Layer) javascript library. It knows how to talk to server or local data storage. It knows how to the interprete data from the server, understanding the metadata for things like validation and association. It knows how to track changes and synchronize those data to sever.

In case of server data storage, upshot can talk to json/xml data services like web api. And in case of local storage, upshot can use html5 local storage. There is even possibility to use local storage when there is no connection with server, and synchronize all changes to server as soon as server is available. This is the great library that makes building SPA application as easy as building normal web application.

If bufferChanges attribute is set to true, Html.UpshotContext(bufferChanges: true), Upshot won’t synchronize changes with the server until we explicitly ask it to. But if set it to false, Html.UpshotContext(bufferChanges: false), changes are immediately send to server. This is a great funcionality if we want to do bulk insert/update, which is great enhancement in terms of performance because it reduces number of http request to server.

This can also perform query against data like sorting, filtering etc.. Moreover, it can perform query against remote data as well as local data, so you don´t have to go to remote if you just want to filter over data that is already in the local.

Knockout video that led me to upshot. http://www.infoq.com/presentations/Knockoutjs?utm_source=infoqEmail&utm_medium=WeeklyNL_EditorialContent&utm_campaign=103012news

Great tutorial on upshot.js http://bartjolling.blogspot.nl/2012/04/building-single-page-apps-with-aspnet.html

Counter part http://datajs.codeplex.com/


No comments:

Post a Comment