InfoQ

News

Bringing MVC to JavaScript - SproutCore

Posted by Shane Witbeck on Aug 14, 2007

Community
Java,
Ruby
Topics
Web Frameworks
Tags
AJAX
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.
SPADE by Remember Objective Posted Aug 14, 2007 9:47 AM
congratulations by Jesse Kuhnert Posted Aug 14, 2007 4:44 PM
Re: congratulations by Charles Jolley Posted Apr 25, 2008 4:21 AM
Re: congratulations by Milan Andric Posted Jun 16, 2008 5:25 PM
SproutCore - business context by Ben Emson Posted Aug 18, 2008 3:40 AM
  1. Back to top

    SPADE

    Aug 14, 2007 9:47 AM 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...

  2. Back to top

    congratulations

    Aug 14, 2007 4:44 PM 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...

  3. Back to top

    Re: congratulations

    Apr 25, 2008 4:21 AM 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

  4. Back to top

    Re: congratulations

    Jun 16, 2008 5:25 PM 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?

  5. Back to top

    SproutCore - business context

    Aug 18, 2008 3:40 AM 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…

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.