Upload
chapados
View
903
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Intro to the Cappuccino web framework (http://cappuccino.org) Embedded version: http://280slides.com/Viewer/?user=2167&name=sdruby-cappuccino&fullscreen
Citation preview
Cappuccino
Brian Chapadoshttp://chapados.org
http://github.com/chapados@chapados
SDRubyAugust 6, 2009
What is it?
"Cappuccino is an open source application framework for developing applications that look and feel like the desktop software users are familiar with."
http://cappuccino.org/learn/
Who made this?
http://280north.com
used framework to build:http://280slides.com
What is it?
http://280slides.com/Editor
The Cappuccino Way
build web apps, not web sites
The Cappuccino Way
• no HTML• no CSS• no DOM manipulation• support for all major browsers
designed explicitly to build web applications from the ground up
All or nothing...
Language: Objective-J
Objective-J
• One language, one API• Superset of javascript• use javascript if you need it• tools for building, compiling to JS, bundling resources for distribution/deployment
Framework: Cappuccino
Cappuccino
• Cocoa-esque API• Battle-tested patterns for building desktop apps
install (StarterKit)
http://cappuccino.org/download/
install (github)
git clone git://github.com/280north/cappuccino.git
rake releaserake debugrake install
capp: setup an appcapp gen -f my-new-app
Generates a new app inmy-new-app
main.jAppController.jindex.htmlindex-debug.html
Info.plistResourcesRakefileFrameworks
Demo pubmed app
Common patterns
• target -> action• delegation (instead of subclassing)• Model-View-Controller
Target : Action
var searchButton = [CPButton buttonWithTitle:"go"];[searchButton setAction:@selector(performSearch:)];[searchButton setTarget:nil];
... define perform search method- (void)performSearch:(id)sender { // do search here}
@selector() a way to encode a method name in a variable
target = nilSearch chain for a responder
Delegation[_searchCollectionView setDelegate:self];
// search history (CPCollectionView) delegate methods - (void)collectionViewDidChangeSelection:(CPCollectionView)collectionView { // do something in response to selection change}
object "self" will respond to delegate messages
define desgined methods in the delegate class
MVC
@implementation AppController : CPObject{PMSearch currentSearch;
CPCollectionView _searchCollectionView;}
model
Controller
view
MVC
@implementation AppController : CPObject{PMSearch currentSearch;
CPCollectionView _searchCollectionView;}
model
Controller
view
Learn More•http://cappuccino.org/learn•cappuccino mailing list (google groups)•http://cappuccinocasts.com/•example apps:•http://cappuccino.org/learn/demos/
Cocoa books•Cocoa Programming for Mac OSX (3rd edition) - Hillegass•Apple's Cocoa Documentation
In many cases, replace "NS" with "CP"it works the same way