Wandering in the desert of plenty: An architect in search of an application architecture
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.
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:
- Brunch with Chaplin
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".
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.
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.