InfoQ

News

Bringing MVC to JavaScript - SproutCore

Posted by Shane Witbeck on Aug 14, 2007 07:00 AM

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.

5 comments

Reply

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

    http://code.google.com/p/trimpath/wiki/SinglePageApplicationAndDevelopmentEnvironment Check out the lightweight Trimpath Junction (Javascript on Rails)... http://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:
    http://rapidappsgroup.com/content/desktop-web-applications-using-sproutcore/
    Ben…

Exclusive Content

SOA Governance: An Enterprise View

Michael Poulin explains the necessity for SOA governance to ensure an Enterprise SOA's success, relying on concepts from the OASIS SOA Reference Model and Reference Architecture.

Developing Portlets using JSF, Ajax, and Seam (Part 2 of 3)

This article covers setting up a RichFaces portlet using JBoss Portlet Container and JBoss Portlet Bridge, deploying a RichFaces portlet, and RichFaces capabilities.

Scalability Worst Practices

This article discusses scalability worst pratices including The Golden Hammer, Resource Abuse, Big Ball of Mud, Dependency Management, Timeouts, Hero Pattern, Not Automating, and Monitoring.

Do the Hustle

Obie Fernandez shares his experience selling consulting services for both Thoughtworks and Hashrocket and give tips how Ruby developers can work with clients.

Natural Laws of Software Development - Deriving Agile Practices

Jeffries and Hendrickson derive Agile practices from the natural laws of software development. They don't just say "Be Agile!", but they explain why Agile practices make perfect sense.

Jinesh Varia About Amazon Alexa Web Service's Architecture

Jinesh Varia talks about the architecture of one of Amazon's web services called Alexa. Jinesh explains how Amazon has reached scalability, performance and reduced costs for the Alexa service.

"We Suck Less!" Is Not Enough

David Douglas and Robin Dymond discuss about companies adopting Agile, but don't go all the way, resulting in failure and rejection of it, and predictably having a negative impact on Agile's future.

The Development of a New Car at Toyota

Kenji Hiranabe talks about Toyota's development process of a new car. Kenji shares his experience meeting Nobuaki Katayama, former Chief Engineer at Toyota, and the lessons he learned from him.