Tuesday, 15 June 2010

End to end MVVM using knockout (javascript) -



End to end MVVM using knockout (javascript) -

i new mvvm , , wanted understand , if have model in end, c# library getting info database or other service. how model notify viewmodel. understand in mvvm inotifyprovier wpf (just read somewhere), how web app based scenario, viewmodel in java-script have ping model identify if there alter in model , propagate ui. assuming viewmodel have send ajax request asmx or api set interval of 10 minutes or (just example). how works end end. illustration great.

because 1 of properties is, automatic ui refresh, assuming fresh info needs asked server @ regular intervals. lot of examples see on web interacting between viewmodel , view, hardly see thing model, viewmodel , view combined together.

i think if 1 uses signalr sends ping server client, viewmodel updated , hence view.

but if every time need inquire fresh set of info sever, what's hype of knockout, jquery has been doing while, except declarative binding stuff, in knockout library.

appreciate if right me.

thanks

it client application fetch new info since server doesn't have concept of observables. there useful mapping plugin automatically map javascript info server observable. way when fetch info don't have re-map data.

however, possible notify client of changes server. 1 way create server force changes client via html5 websockets. signalr library candidate task. open websockets connections server can notify client of changes. , utilize service broker sqldependency trigger event notifications on updates. illustration found here.

good luck!

also here a video watch knockoutjs give understanding of framework.

javascript mvvm model knockout.js knockout-mvvm

No comments:

Post a Comment