18

Declarative and standards-based web application development with the Ample SDK

Embed Size (px)

DESCRIPTION

Presentation of the Ample SDK GUI Framework at the BarCamp in Salzburg / Austria.

Citation preview

Page 1: Declarative and standards-based web application development with the Ample SDK
Page 2: Declarative and standards-based web application development with the Ample SDK

UI Develepoment in the browser?

YES! oh, NO!

the browser API ...HTML, CSS, XML, JavaScript and

the browser API

Page 3: Declarative and standards-based web application development with the Ample SDK

ok we need a framework,but remember

this is only plan b ...

Page 4: Declarative and standards-based web application development with the Ample SDK

Ext JS

jQuery

dojo dijit

MooTools

YUI

JavaScriptMVC

qooxdoo

prototype

SAJAXXAJAX

ASP.NET Ajax

GWT

Raphaël

Cappuccino

jQuery UI

dojoJSF

Ample SDK Backbase

AJAX.org

script.aculo.us

vapor.js

Page 5: Declarative and standards-based web application development with the Ample SDK

Standards for UI Development?

XInclude

SVG XUL

HTML5

SMIL

XSLT DOM

XBL

XHTML

CSS3XML Schema

XForms

REX

W3CWHATWG

Mozilla

Web Controls

XPath

Page 6: Declarative and standards-based web application development with the Ample SDK

XInclude - merge and XML inclusion

SVG - vector graphics (yes in IE5 )

XUL - XML User Interface Language

HTML5 Canvas / Forms

SMIL - Synchronized Multimedia Integration LanguageXSLT - transform XML fragments with XSL-T stylesheets

DOM Level 2 Core / Events & Selector API

CSS2.1 fixes & CSS 3 Namespaces, UI

XPath - expressions to locate XML nodes (in dev.)

Ok Standards, but now? Yes, with Ample SDK:

Page 7: Declarative and standards-based web application development with the Ample SDK

And what is „declarative“ ?programatic

declarative<div id="slider" />

//YUIYUI().use('slider', function (Y) {! var slider = new Y.Slider({! ! min!! : 20,! ! max!! : 40! });! slider.render('#slider');});

// ExtJSnew Ext.Slider({ renderTo!: 'slider', minValue!: 20, maxValue!: 40});

//jQuery UI$('#slider').slider({ ! min!! : 20,! max!! : 40});

// Ajax.org Platform<a:slider min="20" max="40" />

// Backbase<b:slider min="20" max="40" />

//Ample SDK<xul:scale min="20" max="40" />

plain vanilla HTML and JS <div class="x-slider x-slider-horz" id="ext-comp-1001" style="width: 207px;">! <div class="x-slider-end" id="ext-gen3">! ! <div class="x-slider-inner" id="ext-gen4" style="width: 200px;">! ! ! <div class="x-slider-thumb" id="ext-gen6" style="left: -7px;">! ! ! </div>! ! ! <a hidefocus="on" tabindex="-1" href="#" class="x-slider-focus" id="ext-gen5"></a>! ! </div>! </div></div>

Page 8: Declarative and standards-based web application development with the Ample SDK

Ok declarative is shorter,but why it is better?

- again, it is standard base (Mozilla XUL) in Ample SDK

- better readable (and readable for non js guys)

- namespacing and own domain specific markup

- building blocks so easier to maintain- separation of concerns (layout, logic and style)

- ui reusable in the future (or after api change)- easier to split responsibilities in teams (ui dude and js coder)

Page 9: Declarative and standards-based web application development with the Ample SDK

UI DESIGNLOGIC

XUL CSSJavascript

SVG HTML 5DOM Level 3

JAVASCRIPTDEVELOPER

INTERFACEENGINEER

WEB DESIGNER

Page 10: Declarative and standards-based web application development with the Ample SDK

Ladies and Gentlemen, the code ... <head> <!-- (A) Ample SDK runtime and UI language --> <script type="text/javascript" src="ample/runtime.js"></script> <script type="text/javascript" src="ample/languages/xul/xul.js"></script> <link type="text/css" src="ample/languages/xul/themes/default/style.css"/>

<!-- (1) Style --> <style type="text/ample+css"> @namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; xul|button { color: red; } </style>

<!-- (2) Logic --> <script type="text/javascript"> function alertHelloWorld(oEvent) { alert('Element "' + oEvent.target.tagName + '" was clicked'); } </script> </head>

<body>

<!-- (3) Layout --> <script type="application/ample+xml">! <xul:button onclick="alertHelloWorld(event)">Hello, World!</xul:button> </script>!! ! ! ! ! ! !

</body>

Page 11: Declarative and standards-based web application development with the Ample SDK

Text

The Ample SDK way.

- brings features into the browser- fixes existing features- or does nothing if the feature is well implemented

„ ... coding against Ample SDK is like Yeah, doing it against a cross-browser browser! “

equalize browser APIs without introducing new:

Page 12: Declarative and standards-based web application development with the Ample SDK

How it works ...

- Ample SDK is a browser in a browser- generates the browser DOM (shadow) tree

- Ample SDK Node is the brave brother of the DOM Node

Ample SDK DOM Browse DOM (shadow tree)

select

optionoption

div

divdiv

buttoninputdiv div

div div

Page 13: Declarative and standards-based web application development with the Ample SDK

Ample SDK Node API

firstChild, lastChild

previousSibling

nextSibling

childNodes, parentNodegetElementById

getElementsByTagName (NS)

querySelector, querySelectorAll

setAttribute, getAttribute, removeAttribute (NS)

createElement (NS), createTextNode

appendChild, insertBefore, removeChild, replaceChild

Page 14: Declarative and standards-based web application development with the Ample SDK

Node

Document Element

XULElement

XULWindowElement

XHTMLElement

XHTMLElement_div

OWNElement

OWNFancyElement

Class Model (ample.classes)

Page 15: Declarative and standards-based web application development with the Ample SDK

Ample SDK jQuery API

document.getElementById(“slider“).setAttribute(“value“,“30“)

ample.getElementById(“slider“).setAttribute(“value“,“30“)

ample.query(“#slider“).attr(“value“,“30“)

DOM API

AMPLE SDK API

AMPLE SDK jQUERY API

Page 16: Declarative and standards-based web application development with the Ample SDK

Conclusion

- natural client-side development experience

- standard based API that will stay

- modular and readable UI building

- create own domain specific markup language

- open source and available on github

- good separation of concerns (layout, logic and style)

- API validation and guarding

- ...

Page 17: Declarative and standards-based web application development with the Ample SDK

More Information

Sergey Ilinsky @ilinsky

Béla Varga @netzzwerg

amplesdk.com

github.com/clientside/amplesdk

Page 18: Declarative and standards-based web application development with the Ample SDK

THX