Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m building a web app and I need a JS framework like Backbone.js to work with

ID: 646106 • Letter: I

Question

I'm building a web app and I need a JS framework like Backbone.js to work with my backend provided by Rails that mostly return JSON objects after DB queries.

Searching on the web I've discovered Backbone which seems to be complete, quite popular and actively used in development but I've noticed that a lot of things done by Backbone are simply a duplicate of the work done by Rails: for example, validation and models.

My idea of "perfect" (for my actual needs) JS mvc (it can't be called mvc but I don't have a better name) is something really simple that has a function for each action in my Rails controller that is triggered by a specific event (user/hash changes, click on a button...) and sends requests to the server that respond with a JSON object then I'll load a template or execute some JS code.

Do you have any concerns about/suggestions for my idea?

Do you know of some "micro" js framework like what I have described?

If you have worked with backone.js + rails what can you suggest to me?

Explanation / Answer

Do you have any concerns about/suggestions for my idea?
The problem with your idea is that it couples your back end (Rails) with your font end (JavaScript). Also you say that validation on front end and back end is duplicating code, it is to some degree but you need to do it in both ends to make the site usable and safe. Validating front end helps usability where as validation server side is essential to stop hacks and make the site usable for those that turn JavaScript off.

Do you know of some "micro" js framework like what I have described?

There are lots of Javascript MVC/MVVC frameworks out there like backbone and knockout but they are decoupled. This means they are more portable, more usefull and more likely to be worked on and improved.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote