Transcript
Page 1: Ajax In Action 2008 - Gui Development With qooxdoo

colorstrip.gifT

Web GUI-Development with qooxdoo

Fabian Jakobs1&1 Internet AG

THE NEW ERA OF WEB DEVELOPMENT

Ajax in Action29. Oktober 2008

Page 2: Ajax In Action 2008 - Gui Development With qooxdoo

Overview

• Evolution of AJAX

• How Single Page Applications are different

• How qooxdoo can help

Page 3: Ajax In Action 2008 - Gui Development With qooxdoo

HTML only

Page 4: Ajax In Action 2008 - Gui Development With qooxdoo

HTML + JavaScript

Page 5: Ajax In Action 2008 - Gui Development With qooxdoo

HTML + AJAX

+JS

Page 6: Ajax In Action 2008 - Gui Development With qooxdoo

+JS +AJAX

moreAJAX

longerpage load

Page 7: Ajax In Action 2008 - Gui Development With qooxdoo

Single Page Application

+JS +AJAX

Page 8: Ajax In Action 2008 - Gui Development With qooxdoo

+JS +AJAXSinglePage

Page 9: Ajax In Action 2008 - Gui Development With qooxdoo

+JS +AJAXSinglePage

Page 10: Ajax In Action 2008 - Gui Development With qooxdoo

+JS +AJAXSinglePage

Reach

Interactivity

Page 11: Ajax In Action 2008 - Gui Development With qooxdoo

Single Page Applications are Different

+JS +AJAX

SinglePage

Page 12: Ajax In Action 2008 - Gui Development With qooxdoo

Why?

Page 13: Ajax In Action 2008 - Gui Development With qooxdoo

Expectations

„If it looks like a desktop application it should feel like a desktop application!“

Page 14: Ajax In Action 2008 - Gui Development With qooxdoo

Client liberation

• Code is run in the client

• Client/server communication style changes

• Client can maintain state

Page 15: Ajax In Action 2008 - Gui Development With qooxdoo

But:Theming Still Matters!

Page 16: Ajax In Action 2008 - Gui Development With qooxdoo

+JS +AJAXSinglePage

Client code explodes

HTML CSS JavaScript

Page 17: Ajax In Action 2008 - Gui Development With qooxdoo

You Need a Framework!

Page 18: Ajax In Action 2008 - Gui Development With qooxdoo

qooxdoo

Page 19: Ajax In Action 2008 - Gui Development With qooxdoo

qooxdoo

• Cross browser

• JavaScript based RIA framework

• Open Source

• powered by

Page 20: Ajax In Action 2008 - Gui Development With qooxdoo

How does qooxdoo help?

• UI-Expectations

• Theming

• Code Size

Page 21: Ajax In Action 2008 - Gui Development With qooxdoo

Expectations

Page 22: Ajax In Action 2008 - Gui Development With qooxdoo

Swing/Qt/Cocoafor the Web

Page 23: Ajax In Action 2008 - Gui Development With qooxdoo

qooxdoo Architecture

Core (JavaScript OOP)

BOM (Cross Browser Code)

EventAnim.HTML

UI Core(Rendering Engine)

Widgets

Page 24: Ajax In Action 2008 - Gui Development With qooxdoo

Widgets

Page 25: Ajax In Action 2008 - Gui Development With qooxdoo

How would you layout this with CSS?

Page 26: Ajax In Action 2008 - Gui Development With qooxdoo

Absolute positioning!

Page 27: Ajax In Action 2008 - Gui Development With qooxdoo

Layout Manager

• Calculate layout in JavaScript

• Not limited by the browser

• JavaScript is fast enough

Page 28: Ajax In Action 2008 - Gui Development With qooxdoo

Layout Manager

• Calculate layout in JavaScript

• Not limited by the browser

• JavaScript is fast enough

VBox

Page 29: Ajax In Action 2008 - Gui Development With qooxdoo

Layout Manager

• Calculate layout in JavaScript

• Not limited by the browser

• JavaScript is fast enough

VBox

Page 30: Ajax In Action 2008 - Gui Development With qooxdoo

Layout Manager

• Calculate layout in JavaScript

• Not limited by the browser

• JavaScript is fast enough

VBox

Page 31: Ajax In Action 2008 - Gui Development With qooxdoo

Layout Manager

• Calculate layout in JavaScript

• Not limited by the browser

• JavaScript is fast enough

VBoxGrid

Page 32: Ajax In Action 2008 - Gui Development With qooxdoo

Layout Manager

• Calculate layout in JavaScript

• Not limited by the browser

• JavaScript is fast enough

VBoxGrid

Page 33: Ajax In Action 2008 - Gui Development With qooxdoo

Desktop StyleDevelopment Model

// Create a button

var button1 = new qx.ui.form.Button("First Button", "demo/browser.png");

// Add button to container at fixed coordinates

container.add(button1, {left: 100, top: 50});

// Add an event listener

button1.addListener("execute", function(e) {

alert("Hello World!");

});

Page 34: Ajax In Action 2008 - Gui Development With qooxdoo

Theming Matters!

Page 35: Ajax In Action 2008 - Gui Development With qooxdoo

Theming

• 4 images

Page 36: Ajax In Action 2008 - Gui Development With qooxdoo

Theming

• 4 images

Page 37: Ajax In Action 2008 - Gui Development With qooxdoo

Theming

• 4 images

Page 38: Ajax In Action 2008 - Gui Development With qooxdoo

Theming

• 4 images

Page 39: Ajax In Action 2008 - Gui Development With qooxdoo

Theming

• 4 images

• 30 lines configuration

Page 40: Ajax In Action 2008 - Gui Development With qooxdoo

Theming

• 4 images

• 30 lines configuration

• 80 lines theme

"calc-button" : {

style: function(states)

{

return {

decorator: states.pressed ?

"deco-button-pressed" :

"deco-button",

center: true,

padding: [2, 8]

}

}

}

Page 41: Ajax In Action 2008 - Gui Development With qooxdoo

Theming

• 4 images

• 30 lines configuration

• 80 lines theme

"calc-button" : {

style: function(states)

{

return {

decorator: states.pressed ?

"deco-button-pressed" :

"deco-button",

center: true,

padding: [2, 8]

}

}

}

"deco-button": {

decorator: qx.ui.decoration.Grid,

style: {

baseImage: "calc/theme/button.png",

insets: [3, 3, 5, 3]

}

}

Page 42: Ajax In Action 2008 - Gui Development With qooxdoo

Theming

• 4 images

• 30 lines configuration

• 80 lines theme

• 60 minutes work

Page 43: Ajax In Action 2008 - Gui Development With qooxdoo

Theming

Page 44: Ajax In Action 2008 - Gui Development With qooxdoo

Code Size

Page 45: Ajax In Action 2008 - Gui Development With qooxdoo

JavaScript OOPqx.Class.define("demo.Person",

{

extend : qx.core.Object,

construct : function(firstName, lastName)

{

! this.base(arguments);!

!

! this._firstName = firstName;

! this._lastName = lastName;

},

members :

{

getFullName : function() {

return this._firstName + " " + this._lastName;

}

}

});

Page 46: Ajax In Action 2008 - Gui Development With qooxdoo

Linker

Page 47: Ajax In Action 2008 - Gui Development With qooxdoo

JavaScript Tooling

• Unit testing infrastructure

• API documentation generation

• JavaScript Lint

• ...

Page 48: Ajax In Action 2008 - Gui Development With qooxdoo

Use the right approach!

Page 49: Ajax In Action 2008 - Gui Development With qooxdoo

If a Single Page Application (RIA) is the

right choice...

Page 50: Ajax In Action 2008 - Gui Development With qooxdoo

... try qooxdoo!

Page 51: Ajax In Action 2008 - Gui Development With qooxdoo

Thank you.

Fabian Jakobs <[email protected]>http://qooxdoo.org

colorstrip.gifT

THE NEW ERA OF WEB DEVELOPMENT


Top Related