4 ms·
YUI3's APP framework is also a good and IMO a better option.
by digamber_kamat 15y ago
YUI3's APP framework is also a good and IMO a better option.
- knowtheory 15y agoWhat features/design choices do you prefer in YUI3's app framework? (which appears to be here, for the curious: http://yuilibrary.com/yui/docs/app/ http://yuilibrary.com/yui/docs/app/ )
- crescentfresh 15y agoHoly crap. The same paradigms introduced by Backbone are copied by that project with some minor terminology differences (eg Backbone's old name for a Router ("Controller"), a Collection is a ModelList, initialize vs initializer). Of course it's tightly bound to YUI's object model (Y.Base, Y.Node, YUI dom abstractions vs jQuery-like).
- MJR 15y agoThese paradigms weren't introduced by Backbone - they are the standard MVC(Model/View/Controller) constructs in use across many technologies.
- crescentfresh 15y agoWhat paradigms did you think I was referring to? (I didn't actually [mean to] specify any). To clarify, these are some of what I'm referring to (apologies for the code-style formatting - just trying to produce a list): - Backbone.Model/YUI App Model: - Backbone's .previousAttributes vs YUI's .lastChange, used to get the previous value of a changed attribute since the last "change" event - A separate, abstracted Model sync layer for communicating with a server (side note: Backbone 0.9's "sync" event is being introduced in YUI in the next release: http://stage.yuilibrary.com/yui/docs/model/index.html) - .cid (Backbone) vs .clientId (YUI), auto-generated id guaranteed to be unique among all models on the current page. - configuring how the .id property is populated by overriding the .idAttribute property - .collection (Backbone: the Collection containing this model) vs .lists (YUI: array of ModelLists containing this model) - Backbone.View/YUI App View: - .events object literal property that specifies event bindings via dom event delegation, with the css selector in the key - .el (Backbone) vs .container (YUI): managed property representing the view's "container". All delegated events are bound to this element. - Backbone.Collection/YUI App ModelList: - .model specifying the underlying model type by referencing the type's constructor function in the prototype definition directly (I've seen it referenced by global name before, never by constructor reference as Backbone does it) - .getByCid() (Backbone) and getByClientId() (YUI): get a model out of a collection via its auto-generated client id - Backbone.Router/YUI App Controller: class that maps URL changes to methods on the instance. They're also renaming "Controller" to "Router" in an upcoming release, following Backbone's doing of the same in 0.5.3. These are possibly too small to refer to as "paradigms", but the point still stands: they're borrowing these directly from Backbone. If they existed prior to Backbone, my apologies. Also, this is not necessarily a bad thing.
- chc 15y agoMost of these have very close parallels in previous MVC frameworks, such as Rails and Apple's Cocoa. I think the biggest reason YUI3 and Backbone look more similar to each other than to those is because they're both client-side JavaScript frameworks instead of backend like Rails or desktop like Cocoa.
- tsuru 15y agoYou can get a preview of the upcoming release docs for App at http://stage.yuilibrary.com/yui/docs/app http://stage.yuilibrary.com/yui/docs/app
- wavephorm 15y agoBackbone invented nothing, it was not even the first MVC JavaScript library.
- j_s 15y agoThanks for the heads up. Would you mind sharing some details explaining why? I have no experience with either option so an in-depth comparison would be tremendously valuable to me.
- bmelton 15y agoOn what grounds do you say that? Not necessarily disagreeing, I've never used YUI3, but I'd love to hear more about it. I've recently been dabbling in Backbone and, frankly, I'm struggling with lack of documentation. A better documented "competitor" in this space would likely win me as a user. I was hoping it would be Ember/Amber, or something to that extent, but that doesn't appear to be significantly better documented either. What do you consider YUI's strengths / weaknesses vs. Backbone? (Please say documentation).
- jashkenas 15y agoHow would you like the documentation to be improved over the resources that currently exist at Backbonejs.org?
- epidemian 15y agoI'm also curious. I've found the Backbone and Underscore documentation to be pretty good actually. And, in case I'm wondering what a function does _exactly_, the annotated source code (http://backbonejs.org/docs/backbone.html http://backbonejs.org/docs/backbone.html) is more than enough usually.
- bmelton 15y agoPerhaps "lack of documentation" isn't the best synopsis. "lack of documentation for people who don't know what they're doing" is probably more accurate. I've found the documentation to be a great reference, but invariably, due to lack of examples, if I'm trying to implement something I haven't used before, I have to scour the internet for other information before I can generally make sense of the official backbone docs. The best documentation I've found thus far has been other people's projects in Github. While trying not to cargo-cult copy/paste, seeing somebody else implement a feature similar to what I'm trying to do has been the best for me.
- bct 15y ago"Lack of guidance" is the way I'd describe it. The documentation is great, but it didn't help to steer me away from making architectural decisions that don't work well with Backbone when I was doing my first experiments.
- halayli 15y agoYou are comparing apples to oranges imo. Backbone is an MVC framework only, YUI is a lot more. Each tries to accomplish something very different.
- joezimjs 15y agoI think the user was just comparing Backbone to YUI3's MVC framework, therefore making the argument valid.