SlideShare una empresa de Scribd logo
1 de 24
Descargar para leer sin conexión
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!

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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에서 달라진점
 

Similar a 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
 

Similar a 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
 

Último

Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 

Último (20)

Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 

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!