4 ms·
Ignoring this "joke"; If you're looking for a light-weight MVC framework, try Backbone.js. It's rather nice.
by ZeroMinx 15y ago
Ignoring this "joke";
If you're looking for a light-weight MVC framework, try Backbone.js. It's rather nice.
- spamizbad 15y agoI've never used it, but Backbone has a router which struck me as being completely out of place. In practice is it actually a good idea?
- torme 15y agoFor rich client apps, having a router is useful in my experience. I've not used backbone however. What makes you think it seems out of place?
- kennystone 15y agoRouter is integral for doing RESTful right.
- jrockway 15y agoBackbone may be lightweight, but that's only because it's a "framework" for exactly what the authors happened to be doing at the time. If you don't have a collection of objects as a JSON document at /some-url and each object available at /some-url/id, then Backbone does approximately nothing. A simple reimplementation without http support looks something like: Model.prototype.set = function(key, value){ this[key] = value; for(v in views){ v.refresh() } } View.prototype.set_model = function(model){ model.views.push(this) } thing = new Model(); view = new ViewSubclass(); view.set_model(thing); thing.set('foo', 'bar'); # WOWZA THE VIEW UPDATES!!!11!!!
- hendler 15y agoWhile I decided not to use backbone, there is a need for a more structured encapsulation and abstraction of functionality. For example, if the architecture you'd like to build only serves JSON and HTML templates, and javascript renders the rest, you save a lot on bandwith and cpu. The html is cached in the browser, the server only needs to produce JSON. Add a JSON based, restful DB, and you have an architecture that really fits what the web is becoming. The JSON layer is perfectly suited for being the API layer other clients as well - otherwise you might have a lot of crufty code on the server that has to be cleaned up for use by any other client (e.g. native iPhone). BTW - I believe the author of ligament also contributes to http://www.sproutcore.com/ http://www.sproutcore.com/ and jQuery