BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Bringing MVC to JavaScript - SproutCore

Bringing MVC to JavaScript - SproutCore

This item in japanese

SproutIt has released SproutCore a new full MVC application framework for JavaScript. SproutCore was developed at SproutIt for their Mailroom product and has now been adopted by Apple for use in their .Mac Web Gallery. From Tucows:

...SproutCore is a JavaScript framework that runs entirely in the browser. It’s designed to be run against any server back-end setup. At Jolley’s company, SproutIt, they use Rails as the backend; they facilitate the connection through a custom Rails plug-in that’s included with the SproutCore framework. Jolley says that Apple runs SproutCore runs against WebObjects and a WebDAV server...

Given the number of Ajax libraries already available, InfoQ set out to discover what makes SproutCore different by interviewing creator, Charles, Jolley.  Jolly was first asked what inspired him to write another JavaScript framework when there are already several available:

When we built the new version of Mailroom (our support email manager for small businesses - http://www.sproutit.com/mailroom), I wanted to build something very rich, more like desktop software than a web app.

The problem is that other frameworks are really designed to help you spice up web pages with a Ajax and animations here and there; they don't really help you build full applications in the web browser. So when I created Mailroom, I took all the extra things I had to build to support this rich interface and pulled it into a framework of its own.

On the missing features of existing frameworks that SproutCore set out to address he responded:

The primary difference between SproutCore and other frameworks is that it gives you all the tools you get to actually work with real data. In other words, you can actually load data from your server and use SproutCore generate your user interface. As the user works with the data, SproutCore will automatically update your user interface without having to go back to the server. It makes your applications feel very fast and rich.

Take a very simple example: in Mailroom we have this screen called "Needs Attention", which shows you the emails you need to reply to right now. When you reply to a message, we remove it from the Needs Attention page right away.

With traditional frameworks/web apps you'd have to do a round trip to the server or write a lot of extra JavaScript. With SproutCore it is automatic. Just change the state of the message to "replied" and the list of messages will update.

Next Jolley was asked the types of applications he though should and shouldn't use SproutCore:

If you want to build software with a desktop-like richness to it, you should definitely use SproutCore. You will discover very quickly that there are a lot of subtle states you need to maintain on your page once you start adding toolbars, menus, source lists, etc. SproutCore makes it really easy to do this right.

If you have a web page and you just want to spice it up with some Ajax and Animations, SproutCore is too much. I'd use a simpler framework like Scriptaculous. In fact, on our marketings pages and blog at Sproutit, we use Scriptaculous and Prototype. We are using SproutCore for all the web applications we are building, though.

The topic of conversation then shifted to Apple. Jolley explained the collaboration process between himself and Apple on .Mac Galley. He explained that when Apple saw the SpoutCore framework, he was asked to join their team to help them build the application. The team at .Mac added a large amount of functionality to SproutCore in terms of performance and polish to the API. This made the SproutCore AP 4-5x times faster today than it was. It improved cross browser support.

Finally Jolley was asked about what the future holds for SproutCore:

I'm in the process of building out a lot of new widgets such as source lists, toolbars, drag and drop and some really amazing animation that's going to really move the bar in terms of UI design. Perhaps more importantly though, I'm working on building some example apps and tutorials since I think that is the primary barrier to adoption right now.

Rate this Article

Adoption
Style

BT