SproutCore vs卡布奇诺咖啡 [英] SproutCore vs. Cappuccino

查看:82
本文介绍了SproutCore vs卡布奇诺咖啡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了Javascript与Objective-J的语言差异之外,在您的体验中,卡布奇诺咖啡比SproutCore有什么好处,反之亦然?

Aside from the language differences Javascript vs. Objective-J what benefits does Cappuccino provide over SproutCore and vice-versa in your experiences?

就长期预测而言,SproutCore是否比Cappuccino更受支持",因为它得到了Apple的支持?

In terms of a long-term forecast, is SproutCore more "supported" than Cappuccino because it is backed by Apple?

我试图在两者之间进行选择.我对JavaScript和Objective-C都很熟悉.

I am trying to choose between the two. I am both familiar with JavaScript and Objective-C.

推荐答案

这是一个有趣的问题,并且已经在各种消息组,twitter甚至IRC上频繁出现.有两种方法可以评估SproutCore和卡布奇诺咖啡,但也许,人们看到的一些直接特点如下:

This is an interesting question, and one that has been popping up fairly frequently on various messages groups, twitter, and even IRC. There's a couple of ways to evaluate SproutCore versus Cappuccino, but, perhaps, some of the immediate caparisons that people look at are the following:

1)它们各自的功能集
2)易于使用
3)社区支持和文档

1) Their respective feature set
2) Ease of use
3) Community support and documentation

让我们看一下第一点-那里有各自的功能集.通过功能集",有几种方法可以查看它.从它们拥有的UI小部件的数量来看;将事物连接在一起并与某种后端进行通信的基础支持;框架的一般架构方法,虽然不一定是功能",但仍然很重要;是的,甚至是您可以使用的语言.

Let's look at the first point -- there respective feature set. By "feature set" there's a couple of ways to look at it. From the number of UI widgets they have; the foundational support to connect things together and communicate with some kind of back-end; the framework's general architectural approach, although not necessarily a "feature", but still important; and, yes, even the language you can use.

关于语言,我认为不要忽略正在使用的内容(JS与Obj-J)很重要.为什么?因为采用和您来自哪里. SproutCore是从JavaScript确实是Web语言的角度出发的,因此它是您用来对框架进行编程的工具. JavaScript缺乏语言OO完整性(正确的对象-对象继承等)的地方,它可以在框架中弥补(例如MyApp.Foo = SC.Object.extend({...})).卡布奇诺咖啡从另一个角度出现.他们使用Obj-J作为JS的主要语言增强功能,以注入JS缺少的语言功能.而不是将这些语言功能直接注入到框架(Cappuccino)本身.当然,正如Cappuccino上的人们之前所说的那样,您仍然可以使用JS对Cappuccino进行适当的编程,但是,那么您会错过Obj-J提供的功能.卡布奇诺咖啡社区的注意事项:如果我写错了,请指正:-).最后,如果您是已经熟悉Obj-C的人,那么Obj-J可能会更适合您.嘿,甚至Sony显然现在也跳上了整个Obj-C潮流,以针对他们的移动平台:-P进行开发.

Regarding language, I think it's important that you do not dismiss what is being used (JS versus Obj-J). Why? Because of adoption and where you are coming from. SproutCore came from the perspective that JavaScript is indeed the language of the web, so it's what you use to program against the framework. Where JavaScript lacks in language OO completeness (proper object-object inheritance, etc) it makes up for in the framework (e.g. MyApp.Foo = SC.Object.extend({...})). Cappuccino comes in from a different angle. They use Obj-J as a primary language enhancement to JS in order to inject language features that JS is missing; this instead of injecting those language features directly into the framework (Cappuccino) itself. Of course, as the folks over at Cappuccino have noted before, you can still use JS to program against Cappuccino proper, but, then, you miss out on what Obj-J provides. Note to the Cappuccino community: Please correct me if I'm wrong :-). Finally, if you're someone who is already familiar with Obj-C then Obj-J may be more your cup of tea. Hey, even Sony is apparently now jumping on the whole Obj-C bandwagon to develop against their mobile platform :-P.

他们着眼于两个框架的体系结构,都以一种形式或另一种形式着眼于Apple的Cocoa框架,以提供指导/灵感.卡布奇诺咖啡充分考虑了可可,并基本上移植了可可API.同样,如果您来自使用Cocoa在Apple中开发应用程序,那么您可能会感到宾至如归.另一方面,SproutCore从可可那里获得了灵感,感觉很不错.至于纯架构,它们都遵循MVC,它们都使用Cocoa样式的绑定,都有数据存储机制,并且都有各自的呈现和组成UI窗口小部件/视图的样式.

Looking at the architecture of the two frameworks, they both looked at Apple's Cocoa framework for guidance/inspiration in one form or another. Cappuccino took Cocoa fully to heart and basically ported Cocoas API. Again, if you're coming from developing apps in Apple using Cocoa then you're probably going to feel right at home. SproutCore on the other hand took inspiration from Cocoa where it felt right. As for pure architecture, they both follow MVC, they both make use of Cocoa-style bindings, they both have a data store mechanism, and they both have their own respective style of rendering and composing UI widgets/views.

在我看来,呈现视图是一个重要的特定领域.这两个框架都有一定程度的抽象,以使您不必直接处理CSS和HTML,即使最终他们必须渲染Web浏览器最终理解的内容.

The rendering of views is, to me, a particular area of importance. Both frameworks have some level abstraction in order to remove you from directly dealing with CSS and HTML even though at the end of the day they have to render to what the web browser ultimately understands.

在卡布奇诺咖啡方面,他们完全从您那里提取了CSS和HTML.取而代之的是,您使用框架的各种呈现原语来绘制"视图.由于这种抽象水平,Cappuccino可以利用现有的最佳呈现方法,而不必在某种程度上将CSS和HTML与您联系起来.

On the Cappuccino side, they completely abstract away CSS and HTML from you. Instead, you use the framework's various rendering primitives to "draw" your views. Because of this level of abstraction, Cappuccino can make use of the best rendering approach available instead of coupling you, to some degree, with CSS and HTML.

对于SproutCore,可以说,您正在使渲染更接近金属".在进行视图的纯呈现时,您将使用提供一定程度抽象的呈现上下文对象,但是最终,您将直接注入HTML并添加类名以应用CSS.即使在渲染视图并且您想要基于事件来操纵视图的某些部分之后,也可以直接访问DOM元素并操纵它们的属性.取决于您来自哪里,这似乎是好事还是坏事.对于那些习惯使用CSS和HTML并喜欢对视图的呈现和样式进行更直接控制的人来说非常有用.如果要基于浏览器允许的最佳渲染方法来通用地渲染视图(HTML/CSS,SVG,HTML5画布等),则不好.但是请注意,未来有计划使SproutCore具有更抽象的呈现方法,但是如果您愿意的话,仍然允许您直接使用HTML和CSS.因此,您最终将获得两全其美的体验.

As for SproutCore, you are rendering closer to the "metal" so to speak. When doing a pure rendering of a view, you make use of a rendering context object that provides a certain degree of abstraction, but, ultimately, you are directly injecting HTML and adding class names to apply CSS. Even after your view has been rendered and you want to manipulate certain parts of the view based on an event, you can directly access to the DOM elements and manipulate their properties. Depending on where you are coming from this may seem good or bad. Good for those who are used to working with CSS and HTML and like the more direct control over how the views are rendered and styled. Bad if you want to generically render a view in order to make use of the best render approach based on what the browser allows (HTML/CSS, SVG, HTML5 canvas, etc). But, note, there are future plans to make SproutCore have a more abstract rendering approach but still allow you to directly work with HTML and CSS if you so choose. So you'll eventually get the best of both worlds.

现在,对于这两个框架随附的库存UI小部件/视图,它们都具有很多现成的功能,以助您一臂之力.按钮,标签,列表,分段视图,单选按钮,滚动条等-它们都在那里.因此,可以肯定地说您在两个营地中都很好.

Now, as for the stock UI widgets/views the two frameworks come with -- they both have a lot right out of the box in order to get you going. Buttons, labels, lists, segmented views, radio buttons, scrollers, etc -- they're all there. Therefore, it's safe to say you're fine in both camps.

回顾过去,现在让我们讨论易用性.对我来说,易用性取决于您在JavaScript,HTML,Obj-C,Cocoa,其他MVC框架,文档和社区支持方面的个人经验.如果您从未与Cocoa合作过,或者从未构建过类似Decktop或iPad的应用程序,那么可以说,无论选择哪种框架,您都将有一点学习上的弯路.话虽如此,您可以通过每个框架各自的社区和文档来获得您不知道和想要学习的知识.两者都有彼此活跃的社区,因此如果您被困在某个地方,您将不会被冷落.至于文档,卡布奇诺无疑占据了上风.缺少SproutCore的文档,但代码库至少已完整注释. SproutCore社区完全了解需要更新的文档,目前正在处理中,因此请继续检查.

Going all the way back, let's now discuss the ease of use. To me, ease of use is based on you own personal experience working with JavaScript, HTML, Obj-C, Cocoa, other MVC frameworks, documentation, and community support. If you've never worked with Cocoa, or never built a decktop- or iPad-like app, then it's fair to say you're going to have a bit of a learning curve no matter what framework you choose. That being said, what you don't know and want to learn can be acquired through each framework's respective community and docs. Both have active communities in one for or another, so you won't be left out in the cold if you get stuck somewhere. As for docs, Cappuccino, admittedly, has the upper hand. The docs for SproutCore are lacking, but the code base is at least fully commented. The SproutCore community is fully aware of the docs needing to be updated, and it is currently something that is being dealt with, so keep checking.

最后,您提到了这两个框架的长期预测.众所周知,摩托罗拉购买了Cappuccino框架,因此您肯定有一家大公司支持其发展和长寿,或者至少目前看来是这样.至于Apple和SproutCore,我个人不能代表他们,但是Apple不拥有该框架.有许多公司和各种个人都以某种方式使用并回馈框架.由于框架开发的更加有机的性质,这可能会使某些人和公司对那些正在关注SproutCore的人感到停顿或不适,但我认为这不是问题.我的感觉是这两个框架都将存在很长一段时间,尤其是现在,越来越多的人正在考虑使用开源框架开发下一代台式机和iPad应用程序.而且,嘿,框架之间的竞争很好–让每个人都保持各自的脚趾:-).

Finally, you mentioned the long-term forecast for the two frameworks. It's public knowledge that Motorola bought the Cappuccino framework, so you certainly have a big company backing its growth and longevity, or at least it seems like that way for now. As for Apple and SproutCore, I personally can't speak for them, but Apple does not own the framework. There are many companies and various individuals that all use and contribute back to the framework in some way. That might give some people and companies pause or discomfort for those who are looking at SproutCore due to the more organic nature of the framework's development, but I don't see that as a problem. My feeling is that both frameworks will be around for a long time, especially now that more are looking at developing next generation desktop and iPad apps using open source frameworks. And, hey, competition between the frameworks is good -- keeps everyone on their respective toes :-).

希望这些信息可以帮助您做出决定!

Hope this information helps you out with your decision!

干杯

迈克

这篇关于SproutCore vs卡布奇诺咖啡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆