Wandering in the desert of plenty: An architect in search of an application architecture

I need to adopt a javascript dev and deploy stack as framework for my new venture Linguathon. I'm delighted about this project because it brings together language teaching and web app worlds, something I've postponed for decades. So I need to adopt a javascript MV* framework to give me a solid, sound, yet flexible foundation. I have been studying Addy Osmani's Developing Backbone.js Applications (also see the fascinating work in progress mirror http://addyosmani.github.com/backbone-fundamentals/ ), and "What we know now" (as Steve Blank is fond of saying... BTW I'm taking his free online lean startup course and reading his book; don't want to make all the same mistakes all over again :) ) is that I at least don't have the time or even the stupidity to build everything from scratch using a bare bones, self-made, untried and tested by the community dev and deploy stack. I needs me a framework.

But things are moving too fast and crazy for this to be an easy choice. Now, on the one hand, I don't want to be behind a monolith again, where I spend most of my time undoing a myriad "sensible choices", and too many decisions have already been made for me. So I am not going to go with anything where I can't see under the hood and easily configure stuff. Addy comes to the rescue once again (even though what would really be nice would be if he finished his Backbone book once and for all... but it's in the nature of this fast moving world for that too to have to wait on some historic developments now taking place) in explaining why things are so hard in his article "Journey Through The JavaScript MVC Jungle".

Let's take this thorough and fairly recent article as a starting point, please go read it immediately if you haven't already. Already read it? OK, so you know how cool TodoMVC is. It basically takes the famous TODO example that comes with Backbone.js and shows how each of many, many javascript frameworks best re-implement it. It does indeed live up to its punchline "Helping you select an MV* framework".

First conclusions

I need a framework that does this stuff:

  • Scaffolding and generators like Ruby on Rails
  • Modular application architecture through adherance to AMD or CommonJS
  • Publish/Subscribe and Mediator messaging between application modules
  • Business logic in controllers associated with routes, like Spring and Ruby on Rails
  • Layout, region, views control all across the application
  • Memory management and garbage collection so the browser doesn't crash
  • Respect for Coffee Script, so a build system with a watch mode that works
  • Often used stuff that everyone says should have been in Backbone (but which everyone is glad isn't).

Now, this is me, as all the literature explains, you have to base yourself on what your own needs are. Here I'm reporting on my own road taken, and hopefully that might be of use to some other soul.

Candidates

A few months ago my choice would have immediately been Marionette. Still could be. It figures prominently in Addy's book and in the above-mentioned article. It's mature and cool and definitely useful. And would be a good choice. Then two more candidates came up:

Actually the creator of Chaplin has a very nice and cleanly objective slideshow presentation of all three.

Now, all three candidates have in common that they are abstractions of real world frameworks that were used to develop concrete projects.Which means that even though they are new, they are relatively mature. It remains to be seen what the situation is on the community front.

Thorax & Lumbar is the closest to its application womb, is considered "opinionated" and I reject it out of hand due to my criteria of not wanting a lot of decisions made for me.

So Chaplin sat there while I investigated Marionette. And then I thought about the build process and the scaffolding and found Brunch. Brunch is also recommended in the above mentioned Addy Osmani book, for scaffolding. And Brunch has all kinds of skeletons, including Spine, Ember, Angular, and some special custom stacks too.

"Brunch is an assembler for HTML5 applications. It‘s agnostic to frameworks, libraries, programming, stylesheet & templating languages and backend technology.

To simplify app development, brunch watches your files for changes and automatically wraps your scripts and templates in common.js modules." -- from the site

There is a comparison table on the site showing differences with Grunt, Codekit and LiveReload.

So Chaplin itself grabbed my attention due to how close it was to my own criteria. Reading the Chaplin docs and roadmap really made me feel like I was in the presence of high intelligence and a kindred spirit. Its architecture skeleton looked just what I needed, and I could use it with Brunch, so the candidate race narrowed itself down to two.

Kind of. When I went to try out Chaplin, I discovered two competing Chaplin skeletons, both good:

The latter explains its differences with the former as being (apart from an added header)

"CommonJS is used instead of AMD, because it's easier to use & debug".

OK, another article of Addy Osmani's for your reading list: Writing Modular JavaScript With AMD, CommonJS & ES Harmony. 'nuff said.

I really like Brunch with Chaplin. I'm going to try that first. It could be just what I need. I'm going to try it out on a small sample app (look for a branch called "chaplin") and if it doesn't work out I'm going to go with Marionette.

I'm going to publish everything I do here in a series of articles.

Current path

I posted a question on Quora: "What has made you opt for Chaplin vs Marionette as your Backbone.js architectural library?":

"It's not about which one is better: both are good, along with Thorax, as explained by Mathias Schäfer (molily) himself (Chaplin) in his talk Application frameworks on top of Backbone.js. Talk at apps.berlin.js .  And I understand why I need to use some kind of framework and not just backbone.js on its own. I've always used frameworks in my career (Spring for Java, Drupal for CMS apps, Ruby on Rails...). Right now I'm trying to choose between Marionette and Chaplin for a long term development app, and I would be very interested in hearing about what made others choose either one over the other. Thanks!"

Over a hundred people have read the question and seven to date have followed it. But no answer yet. So I'm not alone in this quandry. I need to roll up my sleeves and do some tinkering to find out which will be the most useful to me. Then I guess I'll answer my own question.