|
In case you hadn't yet heard, Cappuccino is a new web application development framework. I know, you're probably thinking, "Why do we need yet another JavaScript library for doing Ajax?!?!" or you might be thinking, "We don't need another RIA technology like Flex or Silverlight!" ... you're right on both accounts, and thankfully Cappuccino is neither of those things!
Traditionally, building a really rich web application inside the context of a browser has always been a pain in the ass. Even when you factor in technologies like Flex or Silverlight, those all work on the concept of plugins. You hit a "rich" page, the page prompts you to download the plugin, you might lose context and be sent off to a different page. Once you've finally got the plugin installed you can go back to your original page and hopefully enjoy the "rich" content.
On the other side of the spectrum you've got the people building web applications using HTML, CSS, and JavaScript. This "pure" implementation of a web application has been getting more and more popular, especially with the advent of more powerful JavaScript/Ajax libraries like jQuery and so on. The problem with this scenario is that your programming model is still this weird mix of client and server side code (server-side code renders your HTML, JavaScript, and CSS, which is actually your client-side code) that can be cumbersome to test and code.
What we all really want is a single unified model for building applications. What we've been craving is a programming model that works in everybody's browser that lets us write rich, unbelievably awesome applications in a way that we as desktop application developers are familiar with. Why? Because more and more web applications are beginning to look like browser-embedded desktop applications, and when browsers start detaching frameless tabs like the Prism project and Chrome's feature, web applications start to look more and more like desktop apps... so the job to code these things is often falling in the laps of people who have experience building desktop apps.
The experience building desktop apps usually don't do us much good when building the web app, other than helping us make some design decisions. But... what if I told you that there was a JavaScript-based framework that gave you a single, unified programming paradigm for all of your client coding needs that didn't use HTML, DHTML, CSS, or even feel very much like JavaScript at all? What if I told you that this unified rich web application programming environment actually felt like Cocoa!? Would you believe me!?
You should, because the folks at 280north have made that vision come true. They've taken JavaScript and extended it to look and feel as much like Objective-C as you can manage. Objective-J is basically a hybrid that incorporates all of the things that we love about Objective-C like the dynamic features, message passing syntax, and the clarity of named, self-documenting parameter names. On top of Objective-C they have included a library of GUI classes that allow us to create views, scrolling regions, graphics, respond to mouse and keyboard events, and much, much more. In essence, if you were to take Cocoa and Objective-C and squeeze them through a web-enabling meat grinder, what came out the other side would be Objective-J and Cappuccino.
Here is some code from one of the Cappuccino tutorials:
var button = [[CPButton alloc]
initWithFrame: CGRectMake( CGRectGetWidth([contentView bounds])/2.0 - 40, CGRectGetMaxY([label frame]) + 10, 80, 18 )];
[button setAutoresizingMask:CPViewMinXMargin |
CPViewMaxXMargin | CPViewMinYMargin | CPViewMaxYMargin];
[button setTitle:"swap"]; [button setTarget:self];
[button setAction:@selector(swap:)];
[contentView addSubview:button];
If you have ever written a line of Cocoa, you're probably squealing with joy right now, thinking, "Holy crap I can write a web application like THAT?! It's THAT easy!?!" That's right - gone are the days when you have to worry about all kinds of stupid JavaScript syntax, cross-browser compatibility case statements, DOM-model checking, and huge bulky combinations of server code, HTML, CSS, and JavaScript. Now, you can just sit down in your favorite editor and write Cappuccino code in Objective-J. Writing web applications like this is a breath of fresh air for anybody that went through the hell of the Ajax "early years".
What it boils down to is this:
Basically if you are thinking about building an interactive web application that takes up the entire browser space available to it, then you should be thinking about doing it in Cappuccino. It's still early in it's development (it was only given to the public a little while ago), but so far it's one of the most promising client-side web application development frameworks I've seen to date.
I highly recommend you go download it right now and start playing with it. Who knows, pretty soon we might even have Core Data and be able to launch NIBs inside a browser!! (wishful thinking, but hey, a guy needs to be able to dream...)
Great post. My only comment is regarding this statement:
Actually, in the Tools directory in the 280North Git repository, there are
a "nib2cib" and a "NibTool" folder. I haven't gotten it to work myself yet,
but according to one of the developers, there already is preliminary
support (just a handful of widgets) for building your Cappuccino
application in Apple's InterfaceBuilder. Twisted, I know.
Heh, I typed "Objective-" so many times in the post I was getting
confused...
Looks cool, have my little app running - as a .net only/windows developer
the objective-j looked like greek :) What editors are you guys using or are
you all on macs? I think this might be a good excuse to get a basic macbook
;)
I have devloped a web site and am trying to use several various different
techniques to build the site