Tyson Lloyd Cadenhead – User Interface Developer
March 30, 2010

Nearly a year ago I was working for a company in the financial services industry that had need for a scalable, secure, AJAX application. It was extremely large in scale and scope and it quickly became clear that I was going to have to have some sort of organizational structure to build the application upon. My server-side experience at this point was primarily in writing C#, and I had fallen in love with the organization of the .NET MVC design pattern. From there, I had been doing some contract work using CakePHP, which is also an MVC framework. While I had written JavaScript for my websites, an entire application is completely different. I looked around at frameworks and eventually settled on JavascriptMVC for its basis in the MVC framework as well as its rich feature set. So what does JavascriptMVC come with “out of the box?”

  • A great architecture using Model-View-Controller. The model handles all of the AJAX calls and post requests, the controller handles all of the events and the view handles the display and DOM manipulation. The view uses EJS templates, which look very much like XHTML, but you can actually pass JavaScript variables into them and use variables, conditionals and loops not unlike a server-side language.
  • Scaffolding.
    You can essentially create a client-side mockup of you database interactions and work independently of the server when needed. This is especially handy if the server-side guys are working out a bug and you need to keep pushing forward.
  • Development, Testing and Production modes.
    Development is great for quick and easy modification, but when you actually launch a project, you can minimize and combine all of your files into one HTTP request just by typing a line into the command line via Rhino. You can easily switch between modes just by changing one line of code. There is functional and unit testing offered through Selenium and Rhino.
  • Easy Documentation.
    Writing documentation is a breeze because it is generated based on the comments in your code!
  • Error handling.
    It plugs into DamnIT to provide error handling and reporting.

I could go on and on about JavascriptMVC, and I just may end up doing that in the future. It is incredible, after all. It’s built around jQuery, so most of the conventions should be familiar to the vast majority of JavaScript people.

I would encourage you to download it and give it a try. There is a bit of a learning curve, but there is documentation as well as an introductory video on the JavascriptMVC website to get you going.

  1. Hi Tyson,

    I’m about to begin a large complex xml marking-up application and I’ve been looking for a decent javascript framework with MVC, that I can use in conjuction with jquery.

    Currently I’m trying to decide between SproutCore and JavascriptMVC. Do you know in what way they differ?

    Kind Regards

    Swami

    Comment by Swami — May 27, 2010 @ 6:05 am

  2. I haven’t really played around with SproutCore, but from what I can tell it does have some pretty nice features. One of the perks about JavascriptMVC is that it’s built on jQuery. There’s a really good article on JavascriptMVC here – http://jupiterjs.com/news/too-enterprisey – by Justin Meyer who developed it.

    Comment by tysoncadenhead — May 27, 2010 @ 8:16 pm

Leave a comment

Portfolio

See More