Upshot/Knockout Architectural Best Practices - What is the preferred provider to use in communicating between Upshot and .NET?
Asked Answered
M

2

9

For a current project, I am trying to get a feel for how to effectively utilize Knockout 2.1.0, Upshot 1.0.0.2, ASP.NET MVC4, and Entity Framework 4.3. There are a lot of basic architectural questions which don't seem to have ready answers. I am enumerating several of my questions (in separate posts) in the hopes that someone can provide reasonable guidance for myself and others as we attempt to implement this combination in real-world applications.

In Steve Sanderson's awesome presentation on Knockout and Upshot.js at TechDays Netherlands in February, he mentioned Upshot can accommodate multiple methods of connecting to a server. (If you have not seen the presentation, it is well worth a watch. You can view it at http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/2159.)

Unfortunately, he did not have time to detail what those communications mechanisms are or which was recommended and in what circumstances.

According to Denver Developer in his blog post titled “Digging into Upshot.js” (http://denverdeveloper.wordpress.com/2012/03/07/digging-into-upshot-js/), there are three data providers exposed by Upshot.js. These are:

• the default is DataProvider() and uses the /Submit method and the operation you provide it to get data using jQuery’s $.ajax method. (AG Note: I believe this generally connects with DbDataController objects exposed by WebAPI but am unsure of precisely what the limitations are.)

• the next is riaDataProvider() – similar to the first, but it uses the /json/SubmitChanges method and /json/{your opertion} to get data

• finally we also have odataDataProvider() – this one is quite different because it does not currently support updating data – it is read-only.

A number of closely related questions naturally present themselves regarding the selection of a provider for typical use.

  • Which data provider is better—the default data provider or the RIA data provider?
  • Which one is recommended for normal use and under what circumstances?
  • What are the performance implications of using the normal DataProvider vs the riaDataProvider?

On a related note, there appears to be very little documentation on upshot on the Internet. Other than drudging through the 4700+ lines of code in upshot.js, are there any other decent sources of documentation for this library?

The resources I have looked at so far include the following (plus a few more).

Megalith answered 23/5, 2012 at 3:41 Comment(0)
A
13

You should avoid using upshot and use http://www.breezejs.com/ instead

ASP.Net MVC Roadmap (note that upshot is not being developed further): http://aspnetwebstack.codeplex.com/wikipage?title=Roadmap

keep an eye on the road map plus john Papa's blog (http://www.johnpapa.net/building-single-page-apps-with-knockout-jquery-and-web-api-ndash-the-story-begins) - that should keep you on the right path

update : i just started playing around with hot towel - it roles Breeze, Durandal.js Knockout.js and Twitter Bootstrap (among others) into a very nice template ...its looking pretty cool so far

https://github.com/johnpapa/HotTowel

Aparejo answered 5/12, 2012 at 20:29 Comment(1)
Thanks for the tip on HotTowel, looks very interesting.Pudendum
T
-1

Which provider to use depends on your server-side dataService type. In my practice they are:

  1. WCF RIA service + upshot (with riaDataProvider) + knockout.
  2. ASP.NET WEB API + upshot (with dataProvider) + knockout. (both will do good job for you!)
  3. WCF data Service + upshot (with oDataProvider) + knockout. (read data only now)
    For oData server side service, "JayData" is a good option
Tommietommy answered 5/6, 2012 at 0:19 Comment(1)
Thank you for your answer, but I believe it simply summarized the information I provided in my question.Megalith

© 2022 - 2024 — McMap. All rights reserved.