cappuccino - sdruby 2009-08-06
DESCRIPTION
Intro to the Cappuccino web framework (http://cappuccino.org) Embedded version: http://280slides.com/Viewer/?user=2167&name=sdruby-cappuccino&fullscreenTRANSCRIPT
![Page 1: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/1.jpg)
Cappuccino
Brian Chapadoshttp://chapados.org
http://github.com/chapados@chapados
SDRubyAugust 6, 2009
![Page 2: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/2.jpg)
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/
![Page 3: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/3.jpg)
Who made this?
http://280north.com
used framework to build:http://280slides.com
![Page 4: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/4.jpg)
What is it?
http://280slides.com/Editor
![Page 5: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/5.jpg)
The Cappuccino Way
build web apps, not web sites
![Page 6: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/6.jpg)
![Page 7: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/7.jpg)
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...
![Page 8: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/8.jpg)
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
![Page 9: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/9.jpg)
Framework: Cappuccino
Cappuccino
• Cocoa-esque API• Battle-tested patterns for building desktop apps
![Page 10: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/10.jpg)
install (StarterKit)
http://cappuccino.org/download/
![Page 11: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/11.jpg)
install (github)
git clone git://github.com/280north/cappuccino.git
rake releaserake debugrake install
![Page 12: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/12.jpg)
capp: setup an appcapp gen -f my-new-app
Generates a new app inmy-new-app
main.jAppController.jindex.htmlindex-debug.html
Info.plistResourcesRakefileFrameworks
![Page 13: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/13.jpg)
Demo pubmed app
![Page 14: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/14.jpg)
Common patterns
• target -> action• delegation (instead of subclassing)• Model-View-Controller
![Page 15: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/15.jpg)
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
![Page 16: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/16.jpg)
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
![Page 17: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/17.jpg)
MVC
@implementation AppController : CPObject{PMSearch currentSearch;
CPCollectionView _searchCollectionView;}
model
Controller
view
![Page 18: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/18.jpg)
MVC
@implementation AppController : CPObject{PMSearch currentSearch;
CPCollectionView _searchCollectionView;}
model
Controller
view
![Page 19: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/19.jpg)
Learn More•http://cappuccino.org/learn•cappuccino mailing list (google groups)•http://cappuccinocasts.com/•example apps:•http://cappuccino.org/learn/demos/
![Page 20: Cappuccino - SDRuby 2009-08-06](https://reader035.vdocument.in/reader035/viewer/2022081516/5587119bd8b42a8a3f8b467f/html5/thumbnails/20.jpg)
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