Introduction to Cappuccino

41
Intro to Cappuccino jason harwig

description

Introduction to the Cappuccino web application framework from 280 North.

Transcript of Introduction to Cappuccino

Page 1: Introduction to Cappuccino

Intro to Cappuccinojason harwig

Page 2: Introduction to Cappuccino

[cappuccino description]

• Open source (LGPL2)

• Client side (BYOBE)

• Web application Framework

Page 3: Introduction to Cappuccino

[cappuccino background]

Page 4: Introduction to Cappuccino
Page 5: Introduction to Cappuccino
Page 6: Introduction to Cappuccino

Extending JavaScript

Page 7: Introduction to Cappuccino

• Classical Inheritance

• Imports

• No Compilation step (GWT)

Page 8: Introduction to Cappuccino

Prototype, Jquery, Dojoextend without new syntax

Page 9: Introduction to Cappuccino

var Animal = Class.create({ initialize: function(name, sound) { this.name = name; this.sound = sound; },

speak: function() { alert(this.name + " says: " + this.sound + "!"); }});

Page 10: Introduction to Cappuccino

ES4, JS 2 Syntax

Page 11: Introduction to Cappuccino

class C extends B { function C(m) { mem = m } public function getmem() { return mem } private var mem : Object};

Page 12: Introduction to Cappuccino

create a superset of JavaScript

Extend a language without breaking legacy/future scripts?

Page 13: Introduction to Cappuccino

Look to History Objective-C

Page 14: Introduction to Cappuccino

Objective-Jsuperset of JavaScript

Page 15: Introduction to Cappuccino

Objective-J Implementation

Page 16: Introduction to Cappuccino

Objective-J

Preprocessor JavaScript

Objective-J File

Page 17: Introduction to Cappuccino

• Valid JavaScript is valid Objective-J

• Syntax resembled Objective-CObjective-J File

Page 18: Introduction to Cappuccino

import <Foundation/CPObject.j>@implementation Animal : CPObject{ CPString name; CPString sound;}- (void)speak{ alert(name + " says: " + sound + "!");}

Page 19: Introduction to Cappuccino

Objective-J

Preprocessor

• Written in JavaScript

• No Plugin Required

• No Compile Step

Page 20: Introduction to Cappuccino

Language Features

Page 21: Introduction to Cappuccino

@import "MyClass.j"

...

Page 22: Introduction to Cappuccino

No Memory Management

Page 23: Introduction to Cappuccino

Categories

Page 24: Introduction to Cappuccino

import <Foundation/CPString.j>

@implementation CPString (Reversing)

- (CPString)reverse{ var reversedString = "", index = [self length]; while(index--) reversedString += [self characterAtIndex: index]; return reversedString;}

@end

Page 25: Introduction to Cappuccino

Static Variables

Page 26: Introduction to Cappuccino

CappuccinoCocoa Framework implemented in Objective-J

Page 27: Introduction to Cappuccino

"Cappuccino is designed for applications, not web pages."

- cappuccino.org

Page 29: Introduction to Cappuccino

Goodbye HTML, CSS, DOM

Page 30: Introduction to Cappuccino

Hello Cocoa for the web

Page 31: Introduction to Cappuccino

NSTextField

CPTextField

Page 32: Introduction to Cappuccino

CAAnimationCABasicAnimation CAFlashLayer CALayer CAMediaTimingFunctionCAPropertyAnimation CPAnimation CPApplication CPArray CPArrayCPBundle CPButton CPClipView CPCoder CPCollectionView CPCollectionViewItem CPColorPanel CPColorPicker CPColorWell CPColorWheelColorPickerCPControl CPCookie CPData CPDate CPDictionary

CPDocument CPDocumentController CPDOMDisplayServer CPDOMWindowBridge CPDOMWindowLayer CPEnumerator CPEvent CPException CPFlashMovie CPFlashView CPFont CPFontManager CPGraphicsContext CPHTTPURLResponse CPImage CPImageView CPIndexSet CPIndexSetCPInvocation CPJSONPConnection CPKeyedArchiver CPKeyedUnarchiver CPKulerColorPicker CPMenu CPMenuItem

CPMutableArray CPMutableIndexSet CPNinePartImage CPNotification CPNotificationCenter CPNull CPNumber CPObject CPPanel CPPasteboard CPPopUpButton CPProgressIndicator CPPropertyListSerializationCPResponder CPRunLoop CPScroller CPScrollView CPSecureTextField CPSegmentedControl CPShadow CPShadowView CPSlider CPSliderColorPicker CPSortDescriptor CPSplitView

CPString CPTabView CPTabViewItem CPTextField CPThreePartImage CPToolbar CPToolbarItem CPUndoManager CPURLConnection CPURLRequest CPURLResponse CPUserSessionManager CPValue CPView CPWebScriptObject CPWebView CPWindow CPWindowController

Page 33: Introduction to Cappuccino

Application Structure

Page 34: Introduction to Cappuccino

NewApplication

AppController.j

Frameworks

AppKit

Foundation

Objective-Jindex.html

Info.plist

main.j

Page 35: Introduction to Cappuccino

Cappuccino Starter

Page 36: Introduction to Cappuccino

Lights Off

Page 37: Introduction to Cappuccino

Build Tools

Press BakeSteam

Page 38: Introduction to Cappuccino

• Manage the build proces

• Create application

• Compile application for release

Steam

Page 39: Introduction to Cappuccino

• Code optimizer

• Combine into on jsPress

Page 40: Introduction to Cappuccino

• Like Rails Capistrano

• Atomic releasesBake

Page 41: Introduction to Cappuccino

• NIB2CIB - User Interface Buildergithub.com/280north/cappuccino/wikis/nib2cib

• Cappucchino Documentation, Tutorials, Demoscappuccino.org

Further Research