introduction to cappuccino

Post on 22-Jun-2015

2.975 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Introduction to the Cappuccino web application framework from 280 North.

TRANSCRIPT

Intro to Cappuccinojason harwig

[cappuccino description]

• Open source (LGPL2)

• Client side (BYOBE)

• Web application Framework

[cappuccino background]

Extending JavaScript

• Classical Inheritance

• Imports

• No Compilation step (GWT)

Prototype, Jquery, Dojoextend without new syntax

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

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

ES4, JS 2 Syntax

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

create a superset of JavaScript

Extend a language without breaking legacy/future scripts?

Look to History Objective-C

Objective-Jsuperset of JavaScript

Objective-J Implementation

Objective-J

Preprocessor JavaScript

Objective-J File

• Valid JavaScript is valid Objective-J

• Syntax resembled Objective-CObjective-J File

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

Objective-J

Preprocessor

• Written in JavaScript

• No Plugin Required

• No Compile Step

Language Features

@import "MyClass.j"

...

No Memory Management

Categories

import <Foundation/CPString.j>

@implementation CPString (Reversing)

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

@end

Static Variables

CappuccinoCocoa Framework implemented in Objective-J

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

- cappuccino.org

Goodbye HTML, CSS, DOM

Hello Cocoa for the web

NSTextField

CPTextField

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

Application Structure

NewApplication

AppController.j

Frameworks

AppKit

Foundation

Objective-Jindex.html

Info.plist

main.j

Cappuccino Starter

Lights Off

Build Tools

Press BakeSteam

• Manage the build proces

• Create application

• Compile application for release

Steam

• Code optimizer

• Combine into on jsPress

• Like Rails Capistrano

• Atomic releasesBake

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

• Cappucchino Documentation, Tutorials, Demoscappuccino.org

Further Research

top related