Building an application to make my brothers life easier
Posted On Sunday, 23 November 2008 at at 17:42 by Rick WalshI'm looking at building a couple of apps (outside of my day job) that will help my brother with his job. The first application will need a rich desktop like interface and so I'm investigating my options.
- Build upon the application framework I've built - this is MVP based which means its highly testable and has good seperation of concerns. It supports templatable views, binding, observers, code generation (via ruby) and is based upon dojo so has access to all the lovely widgets that dojo provides.
- Use an existing framework.
- I want an application framework. A framework that lets me build applications rather than add nice effects to my web pages.
- The framework should abstract away the concepts of html, css and the browser.
- I'm not designing a web page, so for me its perfectly acceptable for my application to look like a windows app or a OS X app. In fact this is desirable since it should mean that my brother will instantly know how to use the application.
- The framework should not be closed source or depend on a browser pluggin.
- Flex (4),
- sliverlight (4),
- extjs (4),
- scriptaculous (1),
- moo tools (1)
- dojo(1)
- Sproutcore
- Cappucino
- Open laszloa
- 1 million other RIA framworks I'm unaware of.
So now I've reduced my area of research down to 3 frameworks. This post will become part of a series which I will investigate these 3 frameworks. The series will serve mainly as a scratch pad, but hopefully may help others.
This remainder of this blog post will discuss my initial thoughts on Sproutcore based upon a few hours reading around and mucking around with code.
Sproutcore Pros.
You write your application prodiminantly in JavaScript.
I dont have to learn an new language!
The framework is based upon MVC.
I like this pattern, I've used it a few times and developed frameworks based upon it. Its simple and usually only the views are difficult to test. I'll talk about views, controllers and models in more detail later. For a good definition of MVC, read this wikipedia article
Its backed by a big boy (Apple)
This means its probably going to be around for a while and should have some money pumped into its development. Apple have in the past branched existing open source projects, invested and changed the licence on the branch. I dont think this will happen here.
Gem
Its installed as a gem and I can generate my application stub, controllers etc at the command line.
Models - Binding and Observing
Sproutcore uses a similar approach to binding model properties to controllers, models and UI as Cocoa bindings. Its easy to "mark" a function as an observer of a property on any given object. In order to notifiy an observer of a change to any of your models properties, you are required to get and set property values on the model via two inherited methods, get and set. To get a property "title" on a model called myModel, I code: myModel.get("title"). To set a property value I call myModel.set("title", "new value here"). This may seem annoying at first since, quite rightly, you will realise that you could just code myModel.title="new value here". However, the set method is not just setting the properties new value, its also informing all observers that the value has changed.
This is incredibly powerful since, for example, views can be kept synchronised with any model they are observing.
Views
View templates are written as rhtml files using templating language called Erubis (ROR uses this, so I'm familiar with the syntax).
Controllers
These appear to be standard MVC controllers.
Sproutcore Cons
You write your application prodiminantly in JavaScript.
While the amount of css and html I've written so far within sproutcore is small, I'm not really abstracted away from the underlying technologies that the browser interprets.
Look
The widgets are UGLY in comparison to those generated by extjs and dojo! I expect this to change!
Documentation is scarce.
This isnt a massive deal, since I can just look at the sproutcore source, although a few more best practice tutorials would be helpful. This may be a problem for developers who are used to the quality of documenation usually associated with commercial frameworks or more establish opensource libraries such as dojo.
Real World apps
The only application I have found that it is available to the public thats built with Sproutcore is the demo photo viewer. This is quite slow and clunky and I hope it isnt a good representation of what can be achieved with Sproutcore. Its a poor show in comparison to 280 slides, a world real world application built with 280North's Cappucino
.And so..
Now I'm going to actually start developing a simple application using sproutcore. I'll write a follow up to this post with opinions based upon 12 or more hours development time. Should provide me with a more informed opinion and I expect the cons list to fill up a little

What about the Zend Framework? It's an open source [BSD] PHP MVC framework. I was looking into Sproutcore but as you had found, it's ugly, and I don't really want to abstract away all the CSS and the HTML while working in a templating language. I guess in this case my templating language is PHP, but then the business logic is too, and so on.