News for hackers. Stuff that matters.
Re:Coding the Angular Tutorial App in Backbone by gumballhead on Wednesday April 16, 2014 @05:13PM (#7600565)
Yes. Backbone basically supplies CRUD mapping and an event bus. So it is opinionated about models.

But CRUD is a solved problem that's easy to implement, and view / controller code ends up being the bulk of your application. I'd rather my framework give me a little help there.

CRUD is even kind of an anti-pattern, because it prevents you from doing relations in your relational database.

Re:Coding the Angular Tutorial App in Backbone by dragonwriter on Wednesday April 16, 2014 @06:45PM (#7600988)
> CRUD is even kind of an anti-pattern, because it prevents you from doing relations in your relational database.

Please explain how doing CRUD operations -- which is, after all, what SQL INSERT, SELECT, UPDATE, and DELETE statements are -- prevents you from doing relations in your relational database. Because that's a seriously wierd claim.

Re:Coding the Angular Tutorial App in Backbone by peterhunt on Wednesday April 16, 2014 @09:44PM (#7601598)
I think REST is more accurate, and REST does a shitty job of efficiently expressing relational data.
Re:Coding the Angular Tutorial App in Backbone by modarts on Wednesday April 16, 2014 @10:40PM (#7601774)
I know React is backend agnostic, but out of curiosity, what does your ideal server API architecture look like if not RESTful?
Re:Coding the Angular Tutorial App in Backbone by peterhunt on Thursday April 17, 2014 @03:47AM (#7602421)
I mean REST has its place. For example, it has very predictable performance and well-known cache characteristics. The problem is when you want to fetch data in repeated rounds, or when you want to fetch data that isn't expressed well as a hierarchy (think a graph with cycles -- not uncommon). That's where it breaks down.

I think you can get pretty far with batched REST, but I'd like to see some way to query graphs in an easier way.

Re:Coding the Angular Tutorial App in Backbone by dustingetz on Thursday April 17, 2014 @12:11PM (#7604467)
I think REST is orthogonal to relational data. (Actual REST, that adheres to HATEOAS and a real REST standard. If one rolls his own JSON services, it's not REST.) HATEOAS puts no constraint on how your data is shaped. A specific implementation of REST may or may not have a nice way to navigate graphs.

[0] http://restcookbook.com/Basics/hateoas/

RESTful Web APIs (2013)[1] is a very, very good book about this stuff. The book has a mailing list with some good discussion about this stuff [2].

[1] http://www.amazon.com/RESTful-Web-APIs-Leonard-Richardson/dp... [2] https://groups.google.com/forum/?fromgroups=#!searchin/colle...

I'm still exploring this stuff myself so maybe I am wrong or misunderstanding you.

Re:Coding the Angular Tutorial App in Backbone by dragonwriter on Thursday April 17, 2014 @09:24AM (#7603373)
How is REST problematic for cyclic graphs? I mean the Web is a graph with many cycles and the Web is the defining instance of a REST application. HATEOAS, a pillar of REST, seems, among other things, to be particularly apt for dealing with arbitrary graphs.
Re:Coding the Angular Tutorial App in Backbone by solomone on Wednesday April 16, 2014 @07:36PM (#7601183)
Perhaps they meant an ORM instead of crud.
Re:Coding the Angular Tutorial App in Backbone by andybak on Wednesday April 16, 2014 @06:38PM (#7600956)
> CRUD is even kind of an anti-pattern, because it prevents you from doing relations in your relational database.

I'm not sure I get this. How are the two things connected? i.e. why can't CRUD honour relations? (Django's admin does auto-CRUD and handles relationships moderately well - at least to one level of nesting)