SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Building Complex GUI Apps The Right Way with Ample SDK The Scandinavian Web Developers Conference 2-3 June 2010, Stockholm, Sweden Sergey Ilinsky
1. Web Application Architecture Transition Server-Side Client-Side Back-End (Business  Logic) Front-End (UI Logic +Rendering +Auth.) Browser Server-Side Client-Side Back-End (Business  Logic) Front-End (Auth.) Front-End (UI Logic +Rendering) Previously Now UI&Data Data (Form data) UI Data (JSON/XML) Data (JSON/XML) Browser
2. HTML5 and client-side GUI Technologies HTML5  [GUI concerns] 1) Limited amount of UI elements 2) Poor-to-none UI elements styling facilities 3) Hardly or not implemented in most of web browsers 4) No extensibility (until XBL2 lands) 5) Too low-level abstraction for applications needs JavaScript GUI Frameworks   (ExtJS, Dojo, Qooxdoo, jQuery UI..) 1) Proprietary (hence->inconsistent) APIs 2) GUI is programmed (in JS+HTML), not declared
3. Demos first! - SVG in Internet Explorer - XUL Cross-Browser - Charts - HTML5
4. Introduction to the Ample SDK Ample SDK is a JavaScript GUI Framework that smartly re-uses concepts and technologies of web-browsers but also brings them to a new level, closer to client-side apps needs. Original goals of the experiment: - equalize browsers APIs without introducing new ones - extend browser UI technologies stacks - provide a platform for reusable UI components
4. Introduction to the Ample SDK : Hello World! <!DOCTYPE html> <html xmlns:xul=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;> <head> <title>Hello, World!</title> <!-- (A) Ample SDK runtime and UI language --> <script type=&quot;text/javascript&quot; src=&quot;ample/runtime.js&quot;></script> <script type=&quot;text/javascript&quot; src=&quot;ample/languages/xul/xul.js&quot;></script> <link type=&quot;text/ample+css&quot; src=&quot;ample/languages/xul/themes/default/xul.css&quot;/> <!-- (1) Styling --> <style type=&quot;text/ample+css&quot;>   @namespace xul &quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;; xul|button { color: red; } </style> <!-- (2) Logic --> <script type=&quot;text/javascript&quot;> function alertHelloWorld(oEvent) { alert('Element &quot;' + oEvent.target.localName + '&quot; was clicked'); } </script> </head> <body> <!-- (3) Layout --> <script type=&quot;application/ample+xml&quot;> <xul:button onclick=&quot;alertHelloWorld(event)&quot;>Hello, World!</b> </script> </body> </html>
4. Introduction to the Ample SDK : The Big Picture Virtualizing browser  technologies: - pass through if available - implement if not - fix if broken
5. Building GUI apps with Ample SDK Programming model is that of web-browser: 1) XML for UI (declarative UIs) 2) CSS for Style 3) JavaScript (DOM API) for Logic
5.1 XML for UI layout: Embedding Ample XML in HTML a) Inline, using a script tag with type=&quot;application/ample+xml&quot; <script type=&quot;application/ ample+ xml&quot;> <!-- Ample SDK inline XML markup --> </script> b) Referencing a resource, using a script tag with src attribute <script type=&quot;application/ ample+ xml&quot; src=&quot;ui.xml&quot;></script> c) Inline, using ample.open() and ample.close() <script type=&quot;text/javascript&quot;>ample.open()</script> <!-- Ample SDK inline XML markup --> <script type=&quot;text/javascript&quot;>ample.close()</script>
5.1 XML for UI layout: Code Sample < xul:toolbox > < xul:toolbar > < xul:toolbargrippy   /> < xul:toolbarbutton   type = &quot;menu&quot;   image = &quot;img/statuses/jab/off.gif&quot;   tooltiptext = &quot;Click to change status&quot; > < xul:menupopup > < xul:menuitem   type = &quot;checkbox&quot;   label = &quot;Invisible&quot;   /> < xul:menuseparator /> < xul:menuitem   label = &quot;Online&quot;   image = &quot;img/statuses/jab/on.gif&quot; /> < xul:menuitem   label = &quot;Away&quot; image = &quot;img/statuses/jab/away.gif&quot; /> < xul:menuitem   label = &quot;Don't disturb&quot;   image = &quot;img/statuses/jab/dnd.gif&quot; /> < xul:menuitem   label = &quot;Not available&quot;   image = &quot;img/statuses/jab/xa.gif&quot; /> < xul:menuitem   label = &quot;Offline&quot;   image = &quot;img/statuses/jab/off.gif&quot; /> </ xul:menupopup > </ xul:toolbarbutton > </ xul:toolbar > </ xul:toolbox >
5.1 XML for UI layout: Technologies - HTML 5  (in development) - SVG 1.1 (Scalable Vector Graphics, W3C) - XHTML (eXtensible Hyper Text Markup Language, W3C) - XUL (XML User interface Language, Mozilla) - Charts  (in development) - your own?
5.2 CSS for Style: Embedding Ample CSS in HTML a) Inline, using a style tag with type=&quot;text/ample+css&quot; <style type=&quot; text/ ample+ css &quot;> @namespace xul url(http://...only.xul); xul|menu:hover { font-variant: italic; } xul|datepicker::value { background-color: red; } </style> b) Referencing a resource, using a link tag with href attribute <link type=&quot;text/ ample+ css&quot;  rel=&quot;stylesheet&quot; href=&quot;stylesheet.css&quot;/>
5.2 CSS for Style: Code Sample xul|menuitem:disabled { color: GrayText; } xul|menuitem[type]::image { background-repeat: no-repeat; width: 16px; height: 16px; vertical-align: middle; } xul|menuitem[type=checkbox]::image { background-position: 0px 16px; /* hidden */ background-image: url(media/menuitem_checkbox.gif); } xul|menuitem[type=radio]::image { background-position: 0px 16px; /* hidden */ background-image: url(media/menuitem_radio.gif); } xul|menuitem::image:checked { background-position: 0px 0px; }
5.2 CSS for Style: Technologies - CSS3 Namespaces @namespace xul url(http://...only.xul); xul| menuitem {font: normal 1em Verdana} - CSS3 UI xul|datepicker ::input  {background-color:pink} - Pseudo-classes (:drag, :resize..) .mytarget :drop  {border: dashed 1px red}
5.3 JS/DOM for UI Logic: Embedding JS in HTML <script type=&quot; text/javascript &quot;> ample .addEventListener(&quot;load&quot;, function(oEvent) { var oNode =  this .querySelector(&quot;svg|circle&quot;); oNode.setAttribute(&quot;r&quot;, 10); }, false); </script> &quot; ample &quot; is an object in Ample SDK similar to &quot;document&quot; object in web browser, it provides access to the document built of all XML fragments found on the page.
5.3 JS/DOM for UI Logic: Technologies Document Object Model - Core (Level 2) - Events (Level 3) - Selectors API Componentization Model API UI Managers - Focus - Drag&Drop - Resize - Capture - SPI History - Text selection
5.3 JS/DOM for UI Logic: More Technologies JavaScript objects   - DOMParser, XMLSerializer - XSLTProcessor - XMLHttpRequest - JSON - JavaScript up to 1.8 objects prototypes XML APIs   - SMIL3.0  (selected modules) ,  - XInclude 1.0 - XML Schema 1.1  (Part 2 - Datatypes) CSS pre-processors  - CSS2.1 (fixes) - CSS3-Namespaces - CSS3-UI
6. Extending Ample SDK 1) Prototyping DOM Objects 2) Creating new UI elements / languages 3) Creating new UI managers
6.1 Prototyping DOM Objects Prototype method on base AMLNode object: AMLNode.prototype.on = function(sType, fHandler) { this.addEventListener(sType, fHandler, false); } function _(sQuery) { return ample.querySelector(sQuery); } Use it for any element: _(“#myelement”).on(“click”, function(event) { alert(event.target.tagName); });
6.2 Creating new UI elements function cMyCombobox() { this.options = new AMLNodeList; } cMyCombobox.prototype = new AMLElement; cMyCombobox.prototype.options = null; // Class-level event handlers cMyCombobox.handlers = { &quot;DOMNodeInsertedIntoDocument&quot;: function(oEvent) { }, &quot;click&quot;: function(oEvent) { } } // Presentation cMyCombobox.prototype.$getTagOpen = function() { return '<div class=&quot;my-combobox&quot;><div> <input class=&quot;my-combobox--input&quot;/><button class=&quot;my-combobox--button&quot;/></div><div class=&quot;my-combobox--gateway&quot;>'; } cMyCombobox.prototype.$getTagClose = function() { return  '</div></div>'; }
6.2 Componentization model explained Web-browser DOM (shadow tree)  (HTML4, SVG/VML) Ample SDK DOM (XHTML, XUL, SVG) select option option div div div div div input button div div
6.3 Creating new UI managers // Adding base element object prototype member AMLElement.prototype.$selectable = null; // Registering Event Handlers with document ample.addEventListener(&quot;mousedown&quot;, function(oEvent) { for (var oElement = oEvent.target, bAllow = false;  oElement.nodeType != AMLNode.DOCUMENT_NODE;  oElement = oElement.parentNode) { if (oElement.$selectable === true) bAllow = true; else if (oElement.$selectable === false) return !bAllow && oEvent.preventDefault(); } }, false);
Wrapping up: Why Ample SDK is relevant? 1) Uses standard APIs that will stay 2) Natural Programming Model (W3C) 3) Provides better UI building blocks, such as XUL 4) Fast rendering 5) Enables quite a bit of SVG1.1 in IE5.5, IE6-8 6) Enables creation of Domain Specific markup
Ample SDK Web-Site:  http://www.amplesdk.com Source-Code:  http://github.com/clientside/amplesdk Reference:  http://www.amplesdk.com/reference Discussions:  http://groups.google.com/group/amplesdk Sergey Ilinsky http://www.ilinsky.com http://twitter.com/ilinsky Thank you!

Weitere ähnliche Inhalte

Was ist angesagt?

Even Faster Web Sites at The Ajax Experience
Even Faster Web Sites at The Ajax ExperienceEven Faster Web Sites at The Ajax Experience
Even Faster Web Sites at The Ajax ExperienceSteve Souders
 
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted NewardArchitecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted NewardJAX London
 
Introduction to PHP Lecture 1
Introduction to PHP Lecture 1Introduction to PHP Lecture 1
Introduction to PHP Lecture 1Ajay Khatri
 
Jscript Fundamentals
Jscript FundamentalsJscript Fundamentals
Jscript Fundamentalsrspaike
 
Basics of Java Script (JS)
Basics of Java Script (JS)Basics of Java Script (JS)
Basics of Java Script (JS)Ajay Khatri
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With BloggingTakatsugu Shigeta
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsJohn Brunswick
 
Introduction to web programming with JavaScript
Introduction to web programming with JavaScriptIntroduction to web programming with JavaScript
Introduction to web programming with JavaScriptT11 Sessions
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat ToolKanika2885
 
Ruby & Python with Silverlight O RLY? YA RLY!
Ruby & Python with Silverlight O RLY? YA RLY!Ruby & Python with Silverlight O RLY? YA RLY!
Ruby & Python with Silverlight O RLY? YA RLY!Martha Rotter
 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsJohannes Geppert
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Jeado Ko
 

Was ist angesagt? (20)

Even Faster Web Sites at The Ajax Experience
Even Faster Web Sites at The Ajax ExperienceEven Faster Web Sites at The Ajax Experience
Even Faster Web Sites at The Ajax Experience
 
Javascript Basic
Javascript BasicJavascript Basic
Javascript Basic
 
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted NewardArchitecture | Busy Java Developers Guide to NoSQL | Ted Neward
Architecture | Busy Java Developers Guide to NoSQL | Ted Neward
 
Introduction to PHP Lecture 1
Introduction to PHP Lecture 1Introduction to PHP Lecture 1
Introduction to PHP Lecture 1
 
Jscript Fundamentals
Jscript FundamentalsJscript Fundamentals
Jscript Fundamentals
 
Basics of Java Script (JS)
Basics of Java Script (JS)Basics of Java Script (JS)
Basics of Java Script (JS)
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With Blogging
 
Changing Template Engine
Changing Template EngineChanging Template Engine
Changing Template Engine
 
Jicc teaching rails
Jicc teaching railsJicc teaching rails
Jicc teaching rails
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on Rails
 
Java script
Java scriptJava script
Java script
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
Introduction to web programming with JavaScript
Introduction to web programming with JavaScriptIntroduction to web programming with JavaScript
Introduction to web programming with JavaScript
 
Java script
Java scriptJava script
Java script
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
 
Ant - Another Neat Tool
Ant - Another Neat ToolAnt - Another Neat Tool
Ant - Another Neat Tool
 
Ruby & Python with Silverlight O RLY? YA RLY!
Ruby & Python with Silverlight O RLY? YA RLY!Ruby & Python with Silverlight O RLY? YA RLY!
Ruby & Python with Silverlight O RLY? YA RLY!
 
Introduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid TagsIntroduction into Struts2 jQuery Grid Tags
Introduction into Struts2 jQuery Grid Tags
 
JavaScript Needn't Hurt!
JavaScript Needn't Hurt!JavaScript Needn't Hurt!
JavaScript Needn't Hurt!
 
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
Angular를 활용한 웹 프론트단 개발과 2.0에서 달라진점
 

Ähnlich wie Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010

Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax componentsIgnacio Coloma
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On RailsWen-Tien Chang
 
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]Chris Toohey
 
Html and i_phone_mobile-2
Html and i_phone_mobile-2Html and i_phone_mobile-2
Html and i_phone_mobile-2tonvanbart
 
HTML5 Overview
HTML5 OverviewHTML5 Overview
HTML5 Overviewreybango
 
Web APIs & Google APIs
Web APIs & Google APIsWeb APIs & Google APIs
Web APIs & Google APIsPamela Fox
 
IBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileIBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileChris Toohey
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query PresentationVishal Kumar
 
jQuery Performance Rules
jQuery Performance RulesjQuery Performance Rules
jQuery Performance Rulesnagarajhubli
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Finalematrix
 
Building real-time collaborative apps with Ajax.org Platform
Building real-time collaborative apps with Ajax.org PlatformBuilding real-time collaborative apps with Ajax.org Platform
Building real-time collaborative apps with Ajax.org PlatformJaveline B.V.
 
Struts2
Struts2Struts2
Struts2yuvalb
 
Beholding the giant pyramid of application development; why Ajax applications...
Beholding the giant pyramid of application development; why Ajax applications...Beholding the giant pyramid of application development; why Ajax applications...
Beholding the giant pyramid of application development; why Ajax applications...Javeline B.V.
 
Ample SDK: A tour de force
Ample SDK: A tour de forceAmple SDK: A tour de force
Ample SDK: A tour de forceSergey Ilinsky
 
Yahoo Mobile Widgets
Yahoo Mobile WidgetsYahoo Mobile Widgets
Yahoo Mobile WidgetsJose Palazon
 
Building high-fidelity interactive prototypes with jQuery
Building high-fidelity interactive prototypes with jQueryBuilding high-fidelity interactive prototypes with jQuery
Building high-fidelity interactive prototypes with jQueryDavid Park
 

Ähnlich wie Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010 (20)

Developing and testing ajax components
Developing and testing ajax componentsDeveloping and testing ajax components
Developing and testing ajax components
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On Rails
 
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
10 Things You're Not Doing [IBM Lotus Notes Domino Application Development]
 
Html and i_phone_mobile-2
Html and i_phone_mobile-2Html and i_phone_mobile-2
Html and i_phone_mobile-2
 
HTML5 Overview
HTML5 OverviewHTML5 Overview
HTML5 Overview
 
Web APIs & Google APIs
Web APIs & Google APIsWeb APIs & Google APIs
Web APIs & Google APIs
 
IBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for MobileIBM Lotus Notes Domino XPages and XPages for Mobile
IBM Lotus Notes Domino XPages and XPages for Mobile
 
J Query Presentation
J Query PresentationJ Query Presentation
J Query Presentation
 
jQuery Performance Rules
jQuery Performance RulesjQuery Performance Rules
jQuery Performance Rules
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Flex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 FinalFlex For Flash Developers Ff 2006 Final
Flex For Flash Developers Ff 2006 Final
 
Building real-time collaborative apps with Ajax.org Platform
Building real-time collaborative apps with Ajax.org PlatformBuilding real-time collaborative apps with Ajax.org Platform
Building real-time collaborative apps with Ajax.org Platform
 
Struts2
Struts2Struts2
Struts2
 
Beholding the giant pyramid of application development; why Ajax applications...
Beholding the giant pyramid of application development; why Ajax applications...Beholding the giant pyramid of application development; why Ajax applications...
Beholding the giant pyramid of application development; why Ajax applications...
 
Ample SDK: A tour de force
Ample SDK: A tour de forceAmple SDK: A tour de force
Ample SDK: A tour de force
 
Java
JavaJava
Java
 
BluePrint Mobile Framework
BluePrint Mobile FrameworkBluePrint Mobile Framework
BluePrint Mobile Framework
 
Yahoo Mobile Widgets
Yahoo Mobile WidgetsYahoo Mobile Widgets
Yahoo Mobile Widgets
 
Building high-fidelity interactive prototypes with jQuery
Building high-fidelity interactive prototypes with jQueryBuilding high-fidelity interactive prototypes with jQuery
Building high-fidelity interactive prototypes with jQuery
 
JQuery 101
JQuery 101JQuery 101
JQuery 101
 

Kürzlich hochgeladen

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 

Kürzlich hochgeladen (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010

  • 1. Building Complex GUI Apps The Right Way with Ample SDK The Scandinavian Web Developers Conference 2-3 June 2010, Stockholm, Sweden Sergey Ilinsky
  • 2. 1. Web Application Architecture Transition Server-Side Client-Side Back-End (Business Logic) Front-End (UI Logic +Rendering +Auth.) Browser Server-Side Client-Side Back-End (Business Logic) Front-End (Auth.) Front-End (UI Logic +Rendering) Previously Now UI&Data Data (Form data) UI Data (JSON/XML) Data (JSON/XML) Browser
  • 3. 2. HTML5 and client-side GUI Technologies HTML5 [GUI concerns] 1) Limited amount of UI elements 2) Poor-to-none UI elements styling facilities 3) Hardly or not implemented in most of web browsers 4) No extensibility (until XBL2 lands) 5) Too low-level abstraction for applications needs JavaScript GUI Frameworks (ExtJS, Dojo, Qooxdoo, jQuery UI..) 1) Proprietary (hence->inconsistent) APIs 2) GUI is programmed (in JS+HTML), not declared
  • 4. 3. Demos first! - SVG in Internet Explorer - XUL Cross-Browser - Charts - HTML5
  • 5. 4. Introduction to the Ample SDK Ample SDK is a JavaScript GUI Framework that smartly re-uses concepts and technologies of web-browsers but also brings them to a new level, closer to client-side apps needs. Original goals of the experiment: - equalize browsers APIs without introducing new ones - extend browser UI technologies stacks - provide a platform for reusable UI components
  • 6. 4. Introduction to the Ample SDK : Hello World! <!DOCTYPE html> <html xmlns:xul=&quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;> <head> <title>Hello, World!</title> <!-- (A) Ample SDK runtime and UI language --> <script type=&quot;text/javascript&quot; src=&quot;ample/runtime.js&quot;></script> <script type=&quot;text/javascript&quot; src=&quot;ample/languages/xul/xul.js&quot;></script> <link type=&quot;text/ample+css&quot; src=&quot;ample/languages/xul/themes/default/xul.css&quot;/> <!-- (1) Styling --> <style type=&quot;text/ample+css&quot;> @namespace xul &quot;http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul&quot;; xul|button { color: red; } </style> <!-- (2) Logic --> <script type=&quot;text/javascript&quot;> function alertHelloWorld(oEvent) { alert('Element &quot;' + oEvent.target.localName + '&quot; was clicked'); } </script> </head> <body> <!-- (3) Layout --> <script type=&quot;application/ample+xml&quot;> <xul:button onclick=&quot;alertHelloWorld(event)&quot;>Hello, World!</b> </script> </body> </html>
  • 7. 4. Introduction to the Ample SDK : The Big Picture Virtualizing browser technologies: - pass through if available - implement if not - fix if broken
  • 8. 5. Building GUI apps with Ample SDK Programming model is that of web-browser: 1) XML for UI (declarative UIs) 2) CSS for Style 3) JavaScript (DOM API) for Logic
  • 9. 5.1 XML for UI layout: Embedding Ample XML in HTML a) Inline, using a script tag with type=&quot;application/ample+xml&quot; <script type=&quot;application/ ample+ xml&quot;> <!-- Ample SDK inline XML markup --> </script> b) Referencing a resource, using a script tag with src attribute <script type=&quot;application/ ample+ xml&quot; src=&quot;ui.xml&quot;></script> c) Inline, using ample.open() and ample.close() <script type=&quot;text/javascript&quot;>ample.open()</script> <!-- Ample SDK inline XML markup --> <script type=&quot;text/javascript&quot;>ample.close()</script>
  • 10. 5.1 XML for UI layout: Code Sample < xul:toolbox > < xul:toolbar > < xul:toolbargrippy /> < xul:toolbarbutton type = &quot;menu&quot; image = &quot;img/statuses/jab/off.gif&quot; tooltiptext = &quot;Click to change status&quot; > < xul:menupopup > < xul:menuitem type = &quot;checkbox&quot; label = &quot;Invisible&quot; /> < xul:menuseparator /> < xul:menuitem label = &quot;Online&quot; image = &quot;img/statuses/jab/on.gif&quot; /> < xul:menuitem label = &quot;Away&quot; image = &quot;img/statuses/jab/away.gif&quot; /> < xul:menuitem label = &quot;Don't disturb&quot; image = &quot;img/statuses/jab/dnd.gif&quot; /> < xul:menuitem label = &quot;Not available&quot; image = &quot;img/statuses/jab/xa.gif&quot; /> < xul:menuitem label = &quot;Offline&quot; image = &quot;img/statuses/jab/off.gif&quot; /> </ xul:menupopup > </ xul:toolbarbutton > </ xul:toolbar > </ xul:toolbox >
  • 11. 5.1 XML for UI layout: Technologies - HTML 5 (in development) - SVG 1.1 (Scalable Vector Graphics, W3C) - XHTML (eXtensible Hyper Text Markup Language, W3C) - XUL (XML User interface Language, Mozilla) - Charts (in development) - your own?
  • 12. 5.2 CSS for Style: Embedding Ample CSS in HTML a) Inline, using a style tag with type=&quot;text/ample+css&quot; <style type=&quot; text/ ample+ css &quot;> @namespace xul url(http://...only.xul); xul|menu:hover { font-variant: italic; } xul|datepicker::value { background-color: red; } </style> b) Referencing a resource, using a link tag with href attribute <link type=&quot;text/ ample+ css&quot; rel=&quot;stylesheet&quot; href=&quot;stylesheet.css&quot;/>
  • 13. 5.2 CSS for Style: Code Sample xul|menuitem:disabled { color: GrayText; } xul|menuitem[type]::image { background-repeat: no-repeat; width: 16px; height: 16px; vertical-align: middle; } xul|menuitem[type=checkbox]::image { background-position: 0px 16px; /* hidden */ background-image: url(media/menuitem_checkbox.gif); } xul|menuitem[type=radio]::image { background-position: 0px 16px; /* hidden */ background-image: url(media/menuitem_radio.gif); } xul|menuitem::image:checked { background-position: 0px 0px; }
  • 14. 5.2 CSS for Style: Technologies - CSS3 Namespaces @namespace xul url(http://...only.xul); xul| menuitem {font: normal 1em Verdana} - CSS3 UI xul|datepicker ::input {background-color:pink} - Pseudo-classes (:drag, :resize..) .mytarget :drop {border: dashed 1px red}
  • 15. 5.3 JS/DOM for UI Logic: Embedding JS in HTML <script type=&quot; text/javascript &quot;> ample .addEventListener(&quot;load&quot;, function(oEvent) { var oNode = this .querySelector(&quot;svg|circle&quot;); oNode.setAttribute(&quot;r&quot;, 10); }, false); </script> &quot; ample &quot; is an object in Ample SDK similar to &quot;document&quot; object in web browser, it provides access to the document built of all XML fragments found on the page.
  • 16. 5.3 JS/DOM for UI Logic: Technologies Document Object Model - Core (Level 2) - Events (Level 3) - Selectors API Componentization Model API UI Managers - Focus - Drag&Drop - Resize - Capture - SPI History - Text selection
  • 17. 5.3 JS/DOM for UI Logic: More Technologies JavaScript objects - DOMParser, XMLSerializer - XSLTProcessor - XMLHttpRequest - JSON - JavaScript up to 1.8 objects prototypes XML APIs - SMIL3.0 (selected modules) , - XInclude 1.0 - XML Schema 1.1 (Part 2 - Datatypes) CSS pre-processors - CSS2.1 (fixes) - CSS3-Namespaces - CSS3-UI
  • 18. 6. Extending Ample SDK 1) Prototyping DOM Objects 2) Creating new UI elements / languages 3) Creating new UI managers
  • 19. 6.1 Prototyping DOM Objects Prototype method on base AMLNode object: AMLNode.prototype.on = function(sType, fHandler) { this.addEventListener(sType, fHandler, false); } function _(sQuery) { return ample.querySelector(sQuery); } Use it for any element: _(“#myelement”).on(“click”, function(event) { alert(event.target.tagName); });
  • 20. 6.2 Creating new UI elements function cMyCombobox() { this.options = new AMLNodeList; } cMyCombobox.prototype = new AMLElement; cMyCombobox.prototype.options = null; // Class-level event handlers cMyCombobox.handlers = { &quot;DOMNodeInsertedIntoDocument&quot;: function(oEvent) { }, &quot;click&quot;: function(oEvent) { } } // Presentation cMyCombobox.prototype.$getTagOpen = function() { return '<div class=&quot;my-combobox&quot;><div> <input class=&quot;my-combobox--input&quot;/><button class=&quot;my-combobox--button&quot;/></div><div class=&quot;my-combobox--gateway&quot;>'; } cMyCombobox.prototype.$getTagClose = function() { return '</div></div>'; }
  • 21. 6.2 Componentization model explained Web-browser DOM (shadow tree) (HTML4, SVG/VML) Ample SDK DOM (XHTML, XUL, SVG) select option option div div div div div input button div div
  • 22. 6.3 Creating new UI managers // Adding base element object prototype member AMLElement.prototype.$selectable = null; // Registering Event Handlers with document ample.addEventListener(&quot;mousedown&quot;, function(oEvent) { for (var oElement = oEvent.target, bAllow = false; oElement.nodeType != AMLNode.DOCUMENT_NODE; oElement = oElement.parentNode) { if (oElement.$selectable === true) bAllow = true; else if (oElement.$selectable === false) return !bAllow && oEvent.preventDefault(); } }, false);
  • 23. Wrapping up: Why Ample SDK is relevant? 1) Uses standard APIs that will stay 2) Natural Programming Model (W3C) 3) Provides better UI building blocks, such as XUL 4) Fast rendering 5) Enables quite a bit of SVG1.1 in IE5.5, IE6-8 6) Enables creation of Domain Specific markup
  • 24. Ample SDK Web-Site: http://www.amplesdk.com Source-Code: http://github.com/clientside/amplesdk Reference: http://www.amplesdk.com/reference Discussions: http://groups.google.com/group/amplesdk Sergey Ilinsky http://www.ilinsky.com http://twitter.com/ilinsky Thank you!