gelviis
gelviis

Reputation: 458

Benefits of using Backbone over jQuery plugin for this example

I'm looking to understand what the key benefits of using Backbone over a jQuery Plugin for this scenario:

I want to allow users to filter and sort these lists. In addition, when a user clicks on a list item it takes them to an edit page (different URL) where the user can edit the details of that particular list item. I would prefer to do this via modal or something similar that removes loading a new page.

Solution 1

I was thinking about using a jQuery plugin (like http://codecanyon.net/item/jquery-jplist-plugin/full_screen_preview/1860318?ref=lvraa) and ajax calls on my existing code to sort and filter li elements across the lists. Doing this I would probably keep the edit page as is or using a modal.

Solution 2

However, after looking at Backbone I was thinking about using it instead of a jQuery plugin. Backbone would handle sorting and filtering the lists plus the editing of the lists. The user could then navigate to other parts of the application (at different urls), which would not be built using Backbone.

What are the benefits of using Backbone for this?

I'm new to Backbone and not sure if this is overkill for what I'm trying to do? Another thing that concerns me is the authentication part when editing one of the list elements.

Upvotes: 0

Views: 504

Answers (2)

Dennis Rongo
Dennis Rongo

Reputation: 4611

You have to step back and look at the bigger picture and see what Backbone brings to the table. IMO, any application that requires working with a set of models or collections can benefit from using Backbone. Backbone is strictly structural and it still requires you write your own filtering functionality. With that said, building your own filtering mechanism will be easier if you bring Backbone in the picture. Backbone and another jQuery plugin can co-exist in the same application since the problems they're addressing are different.

The jQuery plugin can only go as far as manipulating the data that was presented but you still have to do the manual plumbing to take care of getting those data across via an AJAX call (unless the plugin takes care of that for you).

In the end, you can get away with neither one of them. The answer will depend on how you want to structure your application and how much control do you want over it.

Upvotes: 1

Mahbub
Mahbub

Reputation: 3118

Unless you need MVC or MV* structure in your application, you shouldn't need to use BackboneJS. The jQuery plugin will not necessarily be substituted by Backbone. Btw, Backbone uses jQuery by default for DOM related operations. Looking at your requirement, i'd say you can lay out the application using Backbone (I prefer AngularJS though) and use that jQuery plugin if necessary. Just know that a jQuery plugin cannot replace the essence of a MV* framework.

Upvotes: 0

Related Questions