Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GWT vs. Cappuccino [closed]

Tags:

gwt

cappuccino

I'm in the planning stage of a web application and I'm trying to choose between GWT and Cappuccino. I have an idea of which one I think is better, but my partner is sold on the other choice. I was hoping to get some feedback on pros and cons for each from people who have used one or the other or both. Thanks in advance for any insight you might have.

like image 819
James Avatar asked May 29 '10 00:05

James


1 Answers

Toolkit v/s Framework

GWT is a toolkit. Its strength lies in the tools it provides to create an application. It doesn't provide a framework though. Developers usually build a small framework over GWT to suit their needs. There has been a lot of emphasis on MVP pattern to build apps, but it isn't the only way to use GWT.

Cappuccino is a Framework. It has a prescribed way of building applications. Additionally, it provides libraries to perform high level tasks like animation, drag-and-drop undo/redo etc. GWT doesn't provide any libraries for such tasks, though third party libraries are available.

This means that Cappuccino apps tend to be richer than corresponding GWT apps.

Offline Compilation v/s Runtime Translation

GWT believes in making decisions at compile time. Browser detection, I18N, image inlining, generation of sprites, uibinder template evaluation are all performed at compile time. Deferred Binding allows developers to leverage this concept in their own applications.

EDIT

Cappuccino, by default, does not need compilation. The browser downloads objective-j files, and then the framework translates/interprets them directly at runtime. However, it is possible to compile using jake. You can choose from several minifiers/compressors, including google's closure compiler.

As a result of this architectural decision, GWT apps tend to be faster at runtime than equivalent Cappuccino apps. However, because of the compile time cost, development tends to be slower than Cappuccino. GWT development plugin somewhat eases this pain, but the cost doesn't go away entirely.

Since GWT is a closed-world compiler, it can remove unused code, inline method calls, intern strings and optimize code in ways Cappuccino cannot. If Cappuccino were to introduce a compilation step, it could perform the same optimizations; but to the best of my knowledge there is no way to do the translation at compile time.

With the optional compilation step, this point becomes moot. However, cappuccino applications that do not perform such a compilation will have a poor performance as compared to a GWT app.

Type Safety

GWT is java - and is therefore type safe. Objective J is javascript, and therefore dynamically typed. This has its own advantages and disadvantages, and since it is a religious discussion, I will refrain from making a judgement.

Debugging

GWT provides a browser plugin that helps developers directly debug Java code. In development mode, developers get to see java stack traces. At runtime, however, the generated JS code is obfuscated, and very difficult to debug (though there is a way to tell GWT 'don't obfuscate my code').

Using the super-dev-mode it is now possible to debug the Java code directly from the web-browser.

Cappuccino doesn't have a development mode, which means you have to use existing tools like firebug to debug. Errors are reported by the browser, and to debug code you have to use JS debuggers.

Unit Testing

With GWT, you can write pure java unit test cases that do not require a browser to run. This has obvious advantages - speed and ability to reuse existing infrastructure are some of them. When you do need a browser to test, you can choose from GWTTestCase or HTMLUnit. Its also possible to test using Selenium.

Cappuccino apps can be tested using OJTest. Unfortunately, I couldn't find much documentation on the subject, so can't comment much. Of course, you can always use Selenium to test your webapp.

Interoperability with Javascript

GWT provides a way to talk to existing JS libraries - its called Javascript Native Interface. It is mature and works well, but isn't really intuitive. Objective J is javascript, so you don't have to do anything special to inter-operate with Javascript.

Vision

I can't back this argument, but GWT tends to focus on creating high-performance web applications without caring much about look and feel. They never compromise on performance. Cappuccino on the other hand tends to focus on higher level features and frameworks, and compromise on run time performance.

As a result, Cappuccino apps look richer, but take a while to load. GWT apps load and respond faster, but look boring. You can get around both the problems, I am sure - but that's the way it is out-of-the-box.

Community Support and Backing

GWT is backed by Google. Their commitment to GWT is pretty strong. Newer applications (Wave, Adwords, Orkut) from Google are built on GWT. Google IO has had several sessions on GWT. The user forum is pretty active and responsive, and the toolkit itself is actively developed and maintained by Google and the open source community. The Cappuccino user group isn't as active, and has far fewer members.

like image 70
Sripathi Krishnan Avatar answered Oct 31 '22 00:10

Sripathi Krishnan