InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Bringing MVC to JavaScript - SproutCore

Posted by Shane Witbeck on Aug 14, 2007

Sections
Development
Topics
Java ,
Web Frameworks ,
Ruby
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
congratulations by Jesse Kuhnert Posted
Re: congratulations by Charles Jolley Posted
Re: congratulations by Milan Andric Posted
SproutCore - business context by Ben Emson Posted
  1. Back to top

    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...

  2. Back to top

    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...

  3. Back to top

    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

  4. Back to top

    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?

  5. Back to top

    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…

Educational Content

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?

Wrap Your SQL Head Around Riak MapReduce

Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.