views:

551

answers:

2

Hi,

I want to use a javascript framework with MVC for a complex web application (which will be one of a set of related apps and pages) for an intranet in a digital archives. I have been looking at SproutCore and JavascriptMVC. I want to choose one framework and stick with it.

Does anybody know what the distinguishing features are when comparing these two?

I want something that is simple, straightforward that I can customize/hack easily, and that doesn't get in my way too much, but that at the same time gives me a basis for keeping my code nicely organized, and event-driven. I also plan on using jquery substantially.

I know sproutcore is backed by Apple, and looks like it is getting more popular by the day, and it has a nice green website :), whereas JavascriptMVC looks less professional, with less of a following and less momentum behind it.

I've done the tutorials for both and I was impressed by SproutCore more (in the JMVC tutorial you don't really do anything substantial) - but somewhere in the back of my mind I feel that JMVC might just be better because it doesn't try and do too much - it just gives you MVC functionality based on a couple of jquery plugins, and you can use jquery for everything else, so its flexible. Whereas SproutCore seems to have more of its own API etc... which is also nice in a way... but then you're kind of stuck within that.... hmmm I'm confused :).

Any thoughts would be much appreciated.

+2  A: 

I think that the main difference between them is that SproutCore includes a GUI while the JMVC is something low-level without any graphic, so if you need a GUI you can't use JMVC without including other scripts like the jQuery UI or jQuery plugins.

You said that "JMVC might just be better because it doesn't try and do too much" i don't agree with this, it took years before SproutCore 1.0 was released, so developers had the time to make a great product.

I suggest you to use SproutCore, maybe you'll have to learn more things, you'll spend more time to practice and understand everything, but you'll learn how to use a very good framework that can be usefull also for future projects.

mck89
I don't mind learning new things. In fact I really liked the SproutCore syntax, and the way it worked. But the app I am building is quite non-standard - basically gives you an interface to markup xml documents. So a lot of custom work will need to be done - so I thought maybe something lower level is more suitable in this particular case...
swami
But in that way you have to build an interface from your own instead of using a (beautiful) GUI already created. Anyway you say that you don't care about learn new things but this is the last project of your life? i hope not. So next time you'll start with another application you have to do half work because you have already learn everything about the framework. In conclusion you have to choose between building a project with a graphic already created but with a huge framework and a smaller but not GUI framework
mck89
I don't think the UI widgets is SproutCore's biggest strength. It has several attractive things going for it, and at the top of it I would place data binding and property observers. Connecting the view with the model and keeping them in sync requires a **lot** of boilerplate code, and SproutCore reduces it significantly.
Anurag
+1  A: 

Being a JavaScriptMVC contributor, I'm extremely biased. But I'll try to give the best answer I can.

JavaScriptMVC has also taken years to develop. But instead of focusing on ui functionality, it focused on the layers just below that. There are a few reasons for this:

  1. You can find a jQuery widget to meet almost every need. There's no reason to compete these plugins. Instead, JavaScriptMVC tries to work with them.
  2. Most people need one or two custom widgets / controls. JavaScriptMVC wants to make building and maintaining these pieces as easy as possible.'
  3. Flexibility+API. I'm not sure exactly how to say this one ... but here's my best shot ... With JavaScriptMVC, we wanted every layer of the application to be as easy to understand and maintain as possible. This is why we picked jQuery as our low-level library. It's API is about the best abstraction for the dom possible. People typically go directly from the low-level API to build the Widget/Control. This is why most jQuery widgets' code look very dissimilar. We wanted a middle layer that organize our code and promote best practices, while providing enough flexibility to meet almost any requirement. So with JavaScriptMVC, you get very solid low and middle-level layers. But, you don't get widgets.

JavaScriptMVC has testing, error reporting, and documentation baked into the framework. The testing is the most impressive part. It has integrated selenium and envjs testing.

My recommendation would be to go with SproutCoreif your requirements can be built pretty straightforward with SproutCore. But if you know jQuery, have to build a lot of custom controls, or need really awesome testing, use JavaScriptMVC.

Justin Meyer
Currently investigating Dojo now, since we want to use a framework that is more well known and supported (so it's easy to find/hire developers to maintain/extend). However great answer Justin. I'd certainly choose JMVC over Sproutcore for exactly the reasons you have given.
swami