Friday, June 17, 2011

Let your backbone.js slide?

Hey All,

So I have yet to have any time to get to the server side code for my app, I've been continuing to plug away at the front end code in my free time. I currently have a very basic front end working. A calendar is displayed, you can click on any day, it will open a dialog asking you to enter a new todo or event, you can then click on either option and enter the appropriate information and save the item. It was while I was working on the javascript for the controls(done mostly of course with jQuery) that I starting thinking that all this may be better organized by using Backbone.js.

For those unfamiliar with Backbone a brief overview. Backbone is a javascript implementation of the MVC design pattern. It allows you to create "models" for your data, store those models in "collections" which can be manipulated to filter through models. You can also create "views" which display the model data and through "controllers" have on page navigation between various views. A great example app with annotated source can be found here.

So my thoughts are that I could use models to describe my "todos" and "events". The collections features could help with filtering and sorting in the future and creating views for the dialog with it's inputs. This would lead to greater separation of concern in my current design and elements. I would easily be able to create new templates for new features in the future. I am a bit concerned that I may be over complicating things by bringing in the library and possibly could run into issues using it in conjunction with jQuery(the documentation mentions that they are designed to work together but they do share some common features and deciding to go one way could cause issues).

To address the above issues I have decided to get my first use of the much hyped branching feature in git. I'm going to branch off the current version and create a backbone version of the app. I will continue to develop the jQuery heavy version but also experiment with the backbone version so I can see which one is the easier to develop version.

I'm hoping this weekend to get a chance to create the backbone version and to start to implement the server side code with hopes of having a local testing version running next week.

Stay tuned.

No comments:

Post a Comment