BT

Bringing MVC to JavaScript - SproutCore

by Shane Witbeck on Aug 14, 2007 |
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.

Hello stranger!

You need to Register an InfoQ account or to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

SPADE by Remember Objective

code.google.com/p/trimpath/wiki/SinglePageAppli...

Check out the lightweight Trimpath Junction (Javascript on Rails)...
code.google.com/p/trimpath/wiki/TrimJunction

Check out TiddlyWiki...

congratulations by Jesse Kuhnert

You've just re-implemented all of previously native browser logic in javascript and also managed to write ~ 5x more code than you needed if you had done it as if programming in js and not some other language...

Re: congratulations by Charles Jolley

If you think we've over coded parts of SproutCore, I would love for you to help us cut it down. I'm confident there are lots of things you get with SproutCore that did not come natively with the browser or the language that you would find very useful

Re: congratulations by Milan Andric

It's a good point though, no? Why not contribute to the open source browsers like gecko and webkit rather than use javascript? Or am I mis-interpreting what Jesse meant?

SproutCore - business context by Ben Emson

Great article. I’ve written up a post covering Sproutcore from a business angle and why it is important:


rapidappsgroup.com/content/desktop-web-applicat...


Ben…

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

5 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2013 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT