English 中文(简体)
sproutcore vs javascriptMVC for web app development
原标题:

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.

最佳回答

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.

问题回答

Funny, because just a month back or so, our team evaluated exactly these 2 frameworks head to head. We ended up choosing JavaScriptMVC, and I ve been working hands-on with it for about a month.

I like it ... but, I was a HUGE proponent of SproutCore. I had never heard of either framework before we eval d them, but once I saw SproutCore and looked under the hood, I was very, very impressed. Honestly, I don t think there s anything out there that can give you the kind of power it gives. Yes, you ll have a learning curve, but it s the kind of thing that lets one person accomplish the work of 5 or 10 once you know it.

So I d use SproutCore in a heartbeat.

That being said, JavascriptMVC (aka "JMVC") is nice. It doesn t really give you a ton on top of jQuery itself. You will still have some infrastructure to build yourself (depending on how complicated your requirements are). This is both a pro and a con. One nice thing about it is that, if you need to dig into the details of some piece of JMVC, you can ... it is not so incredibly huge that it is impenetrable.

In summary, there s not a thing wrong with JMVC. But there is, in my opinion, nothing even in the ballpark with SproutCore.

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.





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签