SlideShare a Scribd company logo
1 of 24
Cappuccino
A Javascript Application Framework
About me
       Andreas Korth

    Freelance developer

 Mostly Rails and Javascript

Currently employed at PaperC
What Cappuccino is not

• A DOM-oriented widget toolkit (like jQuery)
• The Browser is merely a runtime platform
• The creators didn’t get anything wrong – it’s
 meant that way
What Cappuccino is
• An object-oriented language extension to
  Javascript (Objective-J)

• A Framework for building desktop-classWeb
 Applications

• Can also be bundled as a “native” Application
• Strikingly similar to SproutCore
• Created by 280North, licensed under LGPL
Atlas
• IDE and graphical interface builder written in
 Cappuccino

• Creates the UI and establishes data bindings
• UI can be tested in a live preview mode
• Produces CIB files which simply contain
 serialized instances of UI elements
280Slides




• 280North’s flagship product
• A web-based slide presentation software built
 with Cappuccino
Objective-C
• OO-Layer on top of Ansi C
• GCC comes with a Obj-C compiler
• Much less invasive and conceptually stronger
 than C++

• Introduces some remarkable dynamic concepts
Cocoa
• Apple’s application framework for Mac OS X
• Provides a complete infrastructure for all
 aspects of a desktop app

• Employs smart concepts like delegation and
 object composition

• Leverages the dynamic features of Obj-C
Cappuccino Class Hierarchy
                                     Object




                                    Responder




                          View                   Window




           Control      SplitView


                                              MyFancyView


  Slider   Button    TextBox
Cappuccino Class Composition
   Window
    View ContentView

     SplitView
       View            MyFancyView

                             TextBox

                              Slider

                                     Button
Does Javascript need OO?
• Classes and inheritance are essential to creating
    complex applications

• Prototype-based programming works well for
    Datepickers and Accordions

• It’s difficult to factor a large codebase in JS
•   JS is a scripting language, right?
Classes
• CPObject is the root of the class hierarchy
  @import "CPObject.j"

  @implementation MyObject : CPObject
  {
    int     _age;
    String _name;
    CPArray _items;
  }
  @end
Strong Typing?
• Are you kidding me!?
• Tribute to Cocoa-Developers
• Acts as low-level documentation
• It’s optional – simply omitting all type
 information is valid Obj-J code

• Not enforced at runtime
Methods
• Methods are defined using a minus sign
 @implementation MyObject : CPObject
 {
   String _name;
 }

 - (id)init
 {
   if (self = [super init])
     _name = "Unnamed";

   return self;
 }
 @end
Methods
• Peculiar syntax for parameters:
 - (CPString)handle:(CPObject)object using:(String)method
 {
   // Method Body
 }



• Method invocation:
 [myObject handle:stress using:"patience"];
Methods
• Method calls can be nested:
 [myObject register:[otherObject id]];

 [[user tags] componentsJoinedByString:", "];



• The result of an invocation is a JS-expression:
  [user tags].join(", ");
CPArray
 • Obj-J class with a rich interface
 • Every CPArray is also a regular Javascript-Array
 • Both can be used interchangeably bridging the
   conceptual gap

[users makeObjectsPerformSelector:"setStatus" withObject:"ok"];

users.each(function(user){ [user setStatus:"ok"] });
Categories
• Extend existing classes (aka Mixins, Traits, ...)
  @implementation MyObject (Calling)

  - (void)call:(id)aCallee
  {
       [aCallee call:_name];
  }
  @end
Key-Value Coding
• Object properties conforming to KVC can be
  manipulated using string keys

- (CPString)name               - (void)setName:(CPString)aName
{                              {
  return _name;                  _name = aName;
}                              }


// Invocation                  // Invocation
[object name];                 [object setName:"Pat"];

// KVC                         // KVC
[object valueForKey:"name"];   [object setValue:"Pat" forKey:"name"];
Key-Value Observing
• Any property of any object can be observed
 [object addObserver:self forKeyPath:"name"
   options:CPKeyValueObservingOptionNew context:null];



 // the observer will implement:

 - observeValueForKeyPath:aPath ofObject:anObject 
   change:theChange context:aContext
 {
   // act upon change of value
 }
Reflection
• Objects can be queried whether they respond
 to a certain message
 - (BOOL)respondsToSelector:(SEL)selector
 {
   return true; // yes, we do anything!
 }



• Objects can implement a custom handler for
 undefined messages
 - (void)doesNotRecognizeSelector:(SEL)selector
 {
   // try to sort it out
 }
Runtime
• Obj-J files are compiled into pure JS
• It’s macro-extension rather than compilation
• The compiler itself is written in pure JS
• Obj-J files can be pre-compiled and bundled
 into a single file

• In development classes are loaded and
 compiled at runtime
Conclusion

• Sound concept with clean language extensions
• Framework is not yet complete but gaps are
 closed and bugs are squashed at a fast pace

• Growing HTML5-support will bring significant
 improvements

• Atlas might be the key for wider adption
Thank you!

More Related Content

What's hot

When Camel meets CDI
When Camel meets CDIWhen Camel meets CDI
When Camel meets CDI
Code-House
 
Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platform
Ruslan Shevchenko
 

What's hot (19)

IDLs
IDLsIDLs
IDLs
 
70 536
70 53670 536
70 536
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
 
UI Programming with Qt-Quick and QML
UI Programming with Qt-Quick and QMLUI Programming with Qt-Quick and QML
UI Programming with Qt-Quick and QML
 
Generics
GenericsGenerics
Generics
 
002. Introducere in type script
002. Introducere in type script002. Introducere in type script
002. Introducere in type script
 
When Camel meets CDI
When Camel meets CDIWhen Camel meets CDI
When Camel meets CDI
 
Scal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and AngularScal`a`ngular - Scala and Angular
Scal`a`ngular - Scala and Angular
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
TypeScript 101
TypeScript 101TypeScript 101
TypeScript 101
 
Variables in Pharo5
Variables in Pharo5Variables in Pharo5
Variables in Pharo5
 
Javascript 01 (js)
Javascript 01 (js)Javascript 01 (js)
Javascript 01 (js)
 
Code Generation idioms with Xtend
Code Generation idioms with XtendCode Generation idioms with Xtend
Code Generation idioms with Xtend
 
Jslab rssh: JS as language platform
Jslab rssh:  JS as language platformJslab rssh:  JS as language platform
Jslab rssh: JS as language platform
 
Object Oriented Programming with COBOL
Object Oriented Programming with COBOLObject Oriented Programming with COBOL
Object Oriented Programming with COBOL
 
Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?Future of Kotlin - How agile can language development be?
Future of Kotlin - How agile can language development be?
 
Object Oriented Cobol
Object Oriented CobolObject Oriented Cobol
Object Oriented Cobol
 
2CPP04 - Objects and Classes
2CPP04 - Objects and Classes2CPP04 - Objects and Classes
2CPP04 - Objects and Classes
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 

Viewers also liked

Preparing Cappuccino in 30 minutes
Preparing Cappuccino in 30 minutesPreparing Cappuccino in 30 minutes
Preparing Cappuccino in 30 minutes
LukasHurych
 

Viewers also liked (8)

Cappuccino - SDRuby 2009-08-06
Cappuccino - SDRuby 2009-08-06Cappuccino - SDRuby 2009-08-06
Cappuccino - SDRuby 2009-08-06
 
Introduction to Cappuccino
Introduction to CappuccinoIntroduction to Cappuccino
Introduction to Cappuccino
 
Preparing Cappuccino in 30 minutes
Preparing Cappuccino in 30 minutesPreparing Cappuccino in 30 minutes
Preparing Cappuccino in 30 minutes
 
Cappuccino - ou comment créer une application web en 5 minutes
Cappuccino - ou comment créer une application web en 5 minutes Cappuccino - ou comment créer une application web en 5 minutes
Cappuccino - ou comment créer une application web en 5 minutes
 
Cappuccino @ JSConf 2009
Cappuccino @ JSConf 2009Cappuccino @ JSConf 2009
Cappuccino @ JSConf 2009
 
Coffee beverages
Coffee beveragesCoffee beverages
Coffee beverages
 
Building Large Scale Javascript Application
Building Large Scale Javascript ApplicationBuilding Large Scale Javascript Application
Building Large Scale Javascript Application
 
Starbucks - Innovación,desarrollo e Investigación
Starbucks - Innovación,desarrollo e InvestigaciónStarbucks - Innovación,desarrollo e Investigación
Starbucks - Innovación,desarrollo e Investigación
 

Similar to Cappuccino - A Javascript Application Framework

Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
WO Community
 
Objective-c for Java Developers
Objective-c for Java DevelopersObjective-c for Java Developers
Objective-c for Java Developers
Muhammad Abdullah
 
Никита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-CНикита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-C
DataArt
 
Irving iOS Jumpstart Meetup - Objective-C Session 1a
Irving iOS Jumpstart Meetup - Objective-C Session 1aIrving iOS Jumpstart Meetup - Objective-C Session 1a
Irving iOS Jumpstart Meetup - Objective-C Session 1a
irving-ios-jumpstart
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
Petr Dvorak
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
Vinay H G
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
Chalermpon Areepong
 

Similar to Cappuccino - A Javascript Application Framework (20)

Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Bootstrapping iPhone Development
Bootstrapping iPhone DevelopmentBootstrapping iPhone Development
Bootstrapping iPhone Development
 
Objective-c for Java Developers
Objective-c for Java DevelopersObjective-c for Java Developers
Objective-c for Java Developers
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
 
jQuery Objects
jQuery ObjectsjQuery Objects
jQuery Objects
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescript
 
What Makes Objective C Dynamic?
What Makes Objective C Dynamic?What Makes Objective C Dynamic?
What Makes Objective C Dynamic?
 
Objective-C Is Not Java
Objective-C Is Not JavaObjective-C Is Not Java
Objective-C Is Not Java
 
Никита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-CНикита Корчагин - Programming Apple iOS with Objective-C
Никита Корчагин - Programming Apple iOS with Objective-C
 
JS Essence
JS EssenceJS Essence
JS Essence
 
CPP13 - Object Orientation
CPP13 - Object OrientationCPP13 - Object Orientation
CPP13 - Object Orientation
 
Irving iOS Jumpstart Meetup - Objective-C Session 1a
Irving iOS Jumpstart Meetup - Objective-C Session 1aIrving iOS Jumpstart Meetup - Objective-C Session 1a
Irving iOS Jumpstart Meetup - Objective-C Session 1a
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
 
ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
 
Java 8 selected updates
Java 8 selected updatesJava 8 selected updates
Java 8 selected updates
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
 
UML for Aspect Oriented Design
UML for Aspect Oriented DesignUML for Aspect Oriented Design
UML for Aspect Oriented Design
 
Spring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard WolffSpring Day | Spring and Scala | Eberhard Wolff
Spring Day | Spring and Scala | Eberhard Wolff
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Cappuccino - A Javascript Application Framework

  • 2. About me Andreas Korth Freelance developer Mostly Rails and Javascript Currently employed at PaperC
  • 3. What Cappuccino is not • A DOM-oriented widget toolkit (like jQuery) • The Browser is merely a runtime platform • The creators didn’t get anything wrong – it’s meant that way
  • 4. What Cappuccino is • An object-oriented language extension to Javascript (Objective-J) • A Framework for building desktop-classWeb Applications • Can also be bundled as a “native” Application • Strikingly similar to SproutCore • Created by 280North, licensed under LGPL
  • 5. Atlas • IDE and graphical interface builder written in Cappuccino • Creates the UI and establishes data bindings • UI can be tested in a live preview mode • Produces CIB files which simply contain serialized instances of UI elements
  • 6. 280Slides • 280North’s flagship product • A web-based slide presentation software built with Cappuccino
  • 7. Objective-C • OO-Layer on top of Ansi C • GCC comes with a Obj-C compiler • Much less invasive and conceptually stronger than C++ • Introduces some remarkable dynamic concepts
  • 8. Cocoa • Apple’s application framework for Mac OS X • Provides a complete infrastructure for all aspects of a desktop app • Employs smart concepts like delegation and object composition • Leverages the dynamic features of Obj-C
  • 9. Cappuccino Class Hierarchy Object Responder View Window Control SplitView MyFancyView Slider Button TextBox
  • 10. Cappuccino Class Composition Window View ContentView SplitView View MyFancyView TextBox Slider Button
  • 11. Does Javascript need OO? • Classes and inheritance are essential to creating complex applications • Prototype-based programming works well for Datepickers and Accordions • It’s difficult to factor a large codebase in JS • JS is a scripting language, right?
  • 12. Classes • CPObject is the root of the class hierarchy @import "CPObject.j" @implementation MyObject : CPObject { int _age; String _name; CPArray _items; } @end
  • 13. Strong Typing? • Are you kidding me!? • Tribute to Cocoa-Developers • Acts as low-level documentation • It’s optional – simply omitting all type information is valid Obj-J code • Not enforced at runtime
  • 14. Methods • Methods are defined using a minus sign @implementation MyObject : CPObject { String _name; } - (id)init { if (self = [super init]) _name = "Unnamed"; return self; } @end
  • 15. Methods • Peculiar syntax for parameters: - (CPString)handle:(CPObject)object using:(String)method { // Method Body } • Method invocation: [myObject handle:stress using:"patience"];
  • 16. Methods • Method calls can be nested: [myObject register:[otherObject id]]; [[user tags] componentsJoinedByString:", "]; • The result of an invocation is a JS-expression: [user tags].join(", ");
  • 17. CPArray • Obj-J class with a rich interface • Every CPArray is also a regular Javascript-Array • Both can be used interchangeably bridging the conceptual gap [users makeObjectsPerformSelector:"setStatus" withObject:"ok"]; users.each(function(user){ [user setStatus:"ok"] });
  • 18. Categories • Extend existing classes (aka Mixins, Traits, ...) @implementation MyObject (Calling) - (void)call:(id)aCallee { [aCallee call:_name]; } @end
  • 19. Key-Value Coding • Object properties conforming to KVC can be manipulated using string keys - (CPString)name - (void)setName:(CPString)aName { { return _name; _name = aName; } } // Invocation // Invocation [object name]; [object setName:"Pat"]; // KVC // KVC [object valueForKey:"name"]; [object setValue:"Pat" forKey:"name"];
  • 20. Key-Value Observing • Any property of any object can be observed [object addObserver:self forKeyPath:"name" options:CPKeyValueObservingOptionNew context:null]; // the observer will implement: - observeValueForKeyPath:aPath ofObject:anObject change:theChange context:aContext { // act upon change of value }
  • 21. Reflection • Objects can be queried whether they respond to a certain message - (BOOL)respondsToSelector:(SEL)selector { return true; // yes, we do anything! } • Objects can implement a custom handler for undefined messages - (void)doesNotRecognizeSelector:(SEL)selector { // try to sort it out }
  • 22. Runtime • Obj-J files are compiled into pure JS • It’s macro-extension rather than compilation • The compiler itself is written in pure JS • Obj-J files can be pre-compiled and bundled into a single file • In development classes are loaded and compiled at runtime
  • 23. Conclusion • Sound concept with clean language extensions • Framework is not yet complete but gaps are closed and bugs are squashed at a fast pace • Growing HTML5-support will bring significant improvements • Atlas might be the key for wider adption

Editor's Notes