SlideShare a Scribd company logo
1 of 31
Developing and testing Ajax components Ignacio Coloma [email_address] http://extrema-sistemas.com
The goal Develop  and  test javascript components
Why? We usually get  lost in the details integrating Ajax with java
Two types of web applications RIA  vs  REST (You should choose)
REST misuse This is  not  an iPhone
RIA misuse This is  not  a knife
Don't forget the search engine! You may call it  SEO , We call it
REST and unobtrusive javascript Old: <input onchange=”something()”> New: <input id=”price”> <script> $('price').observe('change', something); </script>
Progressive enhancement Design  for javascript-less Add enhancements  if javascript is present.
User-perceived performance CSS at the top downloaded in parallel JS at the bottom downloaded sequentially <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;> <head> <title>Loom Demo - </title> <link href=&quot;/loomdemo/css/yaml-3.0.5/core/base.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link> <link href=&quot;/loomdemo/css/yaml-3.0.5/navigation/nav_vlist.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link> <link href=&quot;/loomdemo/css/yaml-3.0.5/navigation/nav_slidingdoor.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link> <link href=&quot;/loomdemo/css/yaml-3.0.5/screen/content_default.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link> <link href=&quot;/loomdemo/css/yaml-3.0.5/core/print_base.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link> <!--[if IE]><link href=&quot;/loomdemo/css/yaml-3.0.5/core/iehacks.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link><![endif]--> </head> <body> <div id=&quot;page_margins&quot;> <div id=&quot;page&quot;> <div id=&quot;header&quot;> <div id=&quot;topleft&quot;> <a href=&quot;/loomdemo/&quot; title=&quot;Demo home&quot;>Demo home</a> | <a href=&quot;http://loom.extrema-sistemas.org/&quot; title=&quot;Loom home&quot;>Loom home</a> | <a href=&quot;http://loom.extrema-sistemas.org/get-documentation&quot; title=&quot;Loom doc&quot;>Loom doc</a>  </div> <div id=&quot;topcenter&quot;> Change language: ( <a href=&quot;/loomdemo/support/Locale.action?locale=en&quot; hreflang=&quot;en&quot; class=&quot;selected&quot;>english</a> | <a href=&quot;/loomdemo/support/Locale.action?locale=es&quot; hreflang=&quot;es&quot; class=&quot;&quot;>español</a> ) </div> <div id=&quot;topnav&quot;> <a href=&quot;/loomdemo/other/ViewJspSource.action?jspFilename=/WEB-INF/jsp/ebanking/listAll.jsp&actionName=org.loom.demo.action.ebanking.MortgagesAction&quot; class=&quot;strong&quot; title=&quot;View source&quot;>View source</a> </div> </div>   <div id=&quot;main&quot;> < <div id=&quot;col2&quot;> <div id=&quot;col2_content&quot; class=&quot;clearfix&quot;> <div id=&quot;tips&quot;>   <div class=&quot;hide-fouc important&quot;>Tips are only available with javascript turned on</div> </div> </div> </div> <div id=&quot;col3&quot;> <div id=&quot;col3_content&quot; class=&quot;clearfix&quot;> <form action=&quot;/loomdemo/ebanking/Mortgages.action&quot;> <div class=&quot;buttonBar&quot;> <input type=&quot;submit&quot; value=&quot;Delete&quot; class=&quot;submit&quot; /> </div> <table id=&quot;row&quot;> <thead> <tr> <th class=&quot;first&quot;></th> <th class=&quot;sortable&quot;> <a href=&quot;Mortgages.action?sort=id&amp;event=listAll&amp;dir=asc&quot;>ID</a></th> <th class=&quot;name sortable&quot;> <a href=&quot;Mortgages.action?sort=name&amp;event=listAll&amp;dir=asc&quot;>Name</a></th> <th class=&quot;sortable&quot;> <a href=&quot;Mortgages.action?sort=address&amp;event=listAll&amp;dir=asc&quot;>Address</a></th> <th class=&quot;date sortable&quot;> <a href=&quot;Mortgages.action?sort=principalLoanBalance&amp;event=listAll&amp;dir=asc&quot;>Loan</a></th> <th></th> <th class=&quot;date sortable&quot;> <a href=&quot;Mortgages.action?sort=creationDate&amp;event=listAll&amp;dir=asc&quot;>Creation date</a></th></tr></thead> <tbody> <tr class=&quot;empty&quot;><td colspan=&quot;7&quot;>Nothing found to display.</td></tr> </tbody> </table> <input type=&quot;hidden&quot; name=&quot;__source&quot; value=&quot;/WEB-INF/jsp/ebanking/listAll.jsp&quot;/> <input type=&quot;hidden&quot; name=&quot;event&quot; value=&quot;delete&quot;/> </form> <!-- IE Column Clearing -->  <div id=&quot;ie_clearing&quot;> &#160; </div>  </div> </div> </div> <div id=&quot;footer&quot;> <p style=&quot;float:right&quot;>Layout based on <a href=&quot;http://www.yaml.de/en/home.html&quot;>YAML</a></p>  <p>You are currently one of the 1 users browsing this demo site.  -  <a href=&quot;/loomdemo/about.jsp&quot; title=&quot;about this demo site&quot;>about this demo site</a></p> <p>&copy; 2007 Extrema Sistemas de Informaci&oacute;n - <a href=&quot;http://extrema-sistemas.com/en/legal&quot; title=&quot;Terms of use&quot;>Terms of use</a> -  <a href=&quot;http://extrema-sistemas.com/en/contact&quot; title=&quot;Go to the contact form&quot;>Contact</a> -  <a href=&quot;http://extrema-sistemas.com&quot; title=&quot;Go to Extrema home&quot;>Extrema home</a> </p> </div>   </div> </div> <script src=&quot;//ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js&quot; type=&quot;text/javascript&quot;></script> <script src=&quot;/loomdemo/js/loom-1.0-SNAPSHOT/loom.js&quot; type=&quot;text/javascript&quot;></script> <script src=&quot;//ajax.googleapis.com/ajax/libs/scriptaculous/1.8.1/scriptaculous.js?load=builder,effects&quot; type=&quot;text/javascript&quot;>  </script> <script src=&quot;/loomdemo/js/tips.js&quot; type=&quot;text/javascript&quot;></script> </body> </html>
Custom JSP tag ,[object Object]
Connect  javascript autocompleter <myapp:autocompleter  name=”parent” action=&quot;Entries&quot; event=&quot;getParentCandidates&quot; />
First attempt The server generates  HTML + javascript: <input type=”text”  name=”parent” id=”parent” /> <script> new Autocompleter($(“parent”), { url: “http://localhost/getCandidates.json” }) </script>
Problems ,[object Object]
The javascript code is  generated by the server   (inflexible)
Some libraries  must be loaded  before the HTML  (really bad for performance)
Too many <script> tags  (harder to debug and hurts performance)
Better solution ,[object Object],<input type=”text”  name=”parent”  class=”autocompleter” url=“http://localhost/getCandidates.json” />
Add static javascript code ,[object Object]
This is  your javascript code , not generated by the server: $$('input.autocompleter').each(function(e) { new Autocompleter(e, { url: e.getAttribute('url'); }); });
Benefits ,[object Object]
All javascript code is together  at the end of the page  or inside  external javascript files
Maximum  javascript flexibility
Cleaner code that is  cacheable
Conclusion: HTML as the API ,[object Object]
Test your code Javascript code  should also be tested
Three ways of testing ,[object Object]
Java-driven tests:  WebDriver, Selenium
Javascript-driven tests
Broad choice ,[object Object]
Prototype : UnitTest

More Related Content

What's hot

Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching ResurrectedBen Scofield
 
Developing Gadgets
Developing GadgetsDeveloping Gadgets
Developing GadgetsQuirk
 
Meetup django common_problems(1)
Meetup django common_problems(1)Meetup django common_problems(1)
Meetup django common_problems(1)Eric Satterwhite
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With BloggingTakatsugu Shigeta
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet Sagar Nakul
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical WritingSarah Maddox
 
Mashups as Collection of Widgets
Mashups as Collection of WidgetsMashups as Collection of Widgets
Mashups as Collection of Widgetsgiurca
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?brynary
 
Web APIs & Google APIs
Web APIs & Google APIsWeb APIs & Google APIs
Web APIs & Google APIsPamela Fox
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructurePamela Fox
 
LinkedIn Platform at LeWeb 2010
LinkedIn Platform at LeWeb 2010LinkedIn Platform at LeWeb 2010
LinkedIn Platform at LeWeb 2010Adam Trachtenberg
 
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010Sergey Ilinsky
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptdavejohnson
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenarioArnauld Loyer
 
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)Joshua Warren
 
Developing PHP Web Applications with the Raxan Framework
Developing PHP Web Applications with the Raxan FrameworkDeveloping PHP Web Applications with the Raxan Framework
Developing PHP Web Applications with the Raxan FrameworkRaymond Irving
 

What's hot (20)

Page Caching Resurrected
Page Caching ResurrectedPage Caching Resurrected
Page Caching Resurrected
 
Developing Gadgets
Developing GadgetsDeveloping Gadgets
Developing Gadgets
 
Meetup django common_problems(1)
Meetup django common_problems(1)Meetup django common_problems(1)
Meetup django common_problems(1)
 
Evolution of API With Blogging
Evolution of API With BloggingEvolution of API With Blogging
Evolution of API With Blogging
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
API Technical Writing
API Technical WritingAPI Technical Writing
API Technical Writing
 
Ajax
AjaxAjax
Ajax
 
Changing Template Engine
Changing Template EngineChanging Template Engine
Changing Template Engine
 
Mashups as Collection of Widgets
Mashups as Collection of WidgetsMashups as Collection of Widgets
Mashups as Collection of Widgets
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
Web APIs & Google APIs
Web APIs & Google APIsWeb APIs & Google APIs
Web APIs & Google APIs
 
Spring 2.0
Spring 2.0Spring 2.0
Spring 2.0
 
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google InfrastructureLiving in the Cloud: Hosting Data & Apps Using the Google Infrastructure
Living in the Cloud: Hosting Data & Apps Using the Google Infrastructure
 
LinkedIn Platform at LeWeb 2010
LinkedIn Platform at LeWeb 2010LinkedIn Platform at LeWeb 2010
LinkedIn Platform at LeWeb 2010
 
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
Building Complex GUI Apps The Right Way. With Ample SDK - SWDC2010
 
Pragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScriptPragmatic Parallels: Java and JavaScript
Pragmatic Parallels: Java and JavaScript
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenario
 
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
PHPSpec & Behat: Two Testing Tools That Write Code For You (#phptek edition)
 
Spring 2.0
Spring 2.0Spring 2.0
Spring 2.0
 
Developing PHP Web Applications with the Raxan Framework
Developing PHP Web Applications with the Raxan FrameworkDeveloping PHP Web Applications with the Raxan Framework
Developing PHP Web Applications with the Raxan Framework
 

Viewers also liked

Euro Ia Designing Exploding Websites Share
Euro Ia Designing Exploding Websites ShareEuro Ia Designing Exploding Websites Share
Euro Ia Designing Exploding Websites ShareInfo.nl
 
Styles and development of documentaries
Styles and development of documentariesStyles and development of documentaries
Styles and development of documentariesKostadin Stoimenov
 
5 Busting Tooth Myths You Should Know About
5 Busting Tooth Myths You Should Know About5 Busting Tooth Myths You Should Know About
5 Busting Tooth Myths You Should Know AboutDentist Imus Cavite
 
From Expertise to Experimentation - Future Developing Services with People
From Expertise to Experimentation - Future Developing Services with PeopleFrom Expertise to Experimentation - Future Developing Services with People
From Expertise to Experimentation - Future Developing Services with PeopleReima Rönnholm
 
EuroIA 2009 Designing Exploding Websites Smit Boersma
EuroIA 2009 Designing Exploding Websites Smit BoersmaEuroIA 2009 Designing Exploding Websites Smit Boersma
EuroIA 2009 Designing Exploding Websites Smit BoersmaIskander Smit
 

Viewers also liked (7)

Euro Ia Designing Exploding Websites Share
Euro Ia Designing Exploding Websites ShareEuro Ia Designing Exploding Websites Share
Euro Ia Designing Exploding Websites Share
 
Codemotion appengine
Codemotion appengineCodemotion appengine
Codemotion appengine
 
Styles and development of documentaries
Styles and development of documentariesStyles and development of documentaries
Styles and development of documentaries
 
Css for nondesigners
Css for nondesignersCss for nondesigners
Css for nondesigners
 
5 Busting Tooth Myths You Should Know About
5 Busting Tooth Myths You Should Know About5 Busting Tooth Myths You Should Know About
5 Busting Tooth Myths You Should Know About
 
From Expertise to Experimentation - Future Developing Services with People
From Expertise to Experimentation - Future Developing Services with PeopleFrom Expertise to Experimentation - Future Developing Services with People
From Expertise to Experimentation - Future Developing Services with People
 
EuroIA 2009 Designing Exploding Websites Smit Boersma
EuroIA 2009 Designing Exploding Websites Smit BoersmaEuroIA 2009 Designing Exploding Websites Smit Boersma
EuroIA 2009 Designing Exploding Websites Smit Boersma
 

Similar to Develop and Test Ajax Components

Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2borkweb
 
Java Script
Java ScriptJava Script
Java Scriptsiddaram
 
Struts2
Struts2Struts2
Struts2yuvalb
 
JWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAXJWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAXHilary Mason
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLseleciii44
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NETgoodfriday
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentationipolevoy
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On RailsWen-Tien Chang
 
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM Alfresco Software
 
GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationDavid Calavera
 
Solr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJsSolr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJsWildan Maulana
 
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
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)Carles Farré
 
KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7phuphax
 

Similar to Develop and Test Ajax Components (20)

Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2Javascript: Ajax & DOM Manipulation v1.2
Javascript: Ajax & DOM Manipulation v1.2
 
Jsp
JspJsp
Jsp
 
Java Script
Java ScriptJava Script
Java Script
 
Ajax ons2
Ajax ons2Ajax ons2
Ajax ons2
 
Struts2
Struts2Struts2
Struts2
 
JWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAXJWU Guest Talk: JavaScript and AJAX
JWU Guest Talk: JavaScript and AJAX
 
JSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTLJSP Standart Tag Lİbrary - JSTL
JSP Standart Tag Lİbrary - JSTL
 
Real-World AJAX with ASP.NET
Real-World AJAX with ASP.NETReal-World AJAX with ASP.NET
Real-World AJAX with ASP.NET
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On Rails
 
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
Enterprise Google Gadgets Integrated with Alfresco - Open Source ECM
 
GTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementationGTAC: AtomPub, testing your server implementation
GTAC: AtomPub, testing your server implementation
 
Introduction to JQuery
Introduction to JQueryIntroduction to JQuery
Introduction to JQuery
 
Solr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJsSolr and symfony in Harmony with SolrJs
Solr and symfony in Harmony with SolrJs
 
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]
 
Vb.Net Web Forms
Vb.Net  Web FormsVb.Net  Web Forms
Vb.Net Web Forms
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7KMUTNB - Internet Programming 3/7
KMUTNB - Internet Programming 3/7
 
Merb jQuery
Merb jQueryMerb jQuery
Merb jQuery
 
JSP Custom Tags
JSP Custom TagsJSP Custom Tags
JSP Custom Tags
 

Recently uploaded

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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 SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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...Miguel Araújo
 
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 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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 Scriptwesley chun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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...
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Develop and Test Ajax Components

  • 1. Developing and testing Ajax components Ignacio Coloma [email_address] http://extrema-sistemas.com
  • 2. The goal Develop and test javascript components
  • 3. Why? We usually get lost in the details integrating Ajax with java
  • 4. Two types of web applications RIA vs REST (You should choose)
  • 5. REST misuse This is not an iPhone
  • 6. RIA misuse This is not a knife
  • 7. Don't forget the search engine! You may call it SEO , We call it
  • 8. REST and unobtrusive javascript Old: <input onchange=”something()”> New: <input id=”price”> <script> $('price').observe('change', something); </script>
  • 9. Progressive enhancement Design for javascript-less Add enhancements if javascript is present.
  • 10. User-perceived performance CSS at the top downloaded in parallel JS at the bottom downloaded sequentially <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;> <head> <title>Loom Demo - </title> <link href=&quot;/loomdemo/css/yaml-3.0.5/core/base.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link> <link href=&quot;/loomdemo/css/yaml-3.0.5/navigation/nav_vlist.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link> <link href=&quot;/loomdemo/css/yaml-3.0.5/navigation/nav_slidingdoor.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link> <link href=&quot;/loomdemo/css/yaml-3.0.5/screen/content_default.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link> <link href=&quot;/loomdemo/css/yaml-3.0.5/core/print_base.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link> <!--[if IE]><link href=&quot;/loomdemo/css/yaml-3.0.5/core/iehacks.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;></link><![endif]--> </head> <body> <div id=&quot;page_margins&quot;> <div id=&quot;page&quot;> <div id=&quot;header&quot;> <div id=&quot;topleft&quot;> <a href=&quot;/loomdemo/&quot; title=&quot;Demo home&quot;>Demo home</a> | <a href=&quot;http://loom.extrema-sistemas.org/&quot; title=&quot;Loom home&quot;>Loom home</a> | <a href=&quot;http://loom.extrema-sistemas.org/get-documentation&quot; title=&quot;Loom doc&quot;>Loom doc</a> </div> <div id=&quot;topcenter&quot;> Change language: ( <a href=&quot;/loomdemo/support/Locale.action?locale=en&quot; hreflang=&quot;en&quot; class=&quot;selected&quot;>english</a> | <a href=&quot;/loomdemo/support/Locale.action?locale=es&quot; hreflang=&quot;es&quot; class=&quot;&quot;>español</a> ) </div> <div id=&quot;topnav&quot;> <a href=&quot;/loomdemo/other/ViewJspSource.action?jspFilename=/WEB-INF/jsp/ebanking/listAll.jsp&actionName=org.loom.demo.action.ebanking.MortgagesAction&quot; class=&quot;strong&quot; title=&quot;View source&quot;>View source</a> </div> </div> <div id=&quot;main&quot;> < <div id=&quot;col2&quot;> <div id=&quot;col2_content&quot; class=&quot;clearfix&quot;> <div id=&quot;tips&quot;> <div class=&quot;hide-fouc important&quot;>Tips are only available with javascript turned on</div> </div> </div> </div> <div id=&quot;col3&quot;> <div id=&quot;col3_content&quot; class=&quot;clearfix&quot;> <form action=&quot;/loomdemo/ebanking/Mortgages.action&quot;> <div class=&quot;buttonBar&quot;> <input type=&quot;submit&quot; value=&quot;Delete&quot; class=&quot;submit&quot; /> </div> <table id=&quot;row&quot;> <thead> <tr> <th class=&quot;first&quot;></th> <th class=&quot;sortable&quot;> <a href=&quot;Mortgages.action?sort=id&amp;event=listAll&amp;dir=asc&quot;>ID</a></th> <th class=&quot;name sortable&quot;> <a href=&quot;Mortgages.action?sort=name&amp;event=listAll&amp;dir=asc&quot;>Name</a></th> <th class=&quot;sortable&quot;> <a href=&quot;Mortgages.action?sort=address&amp;event=listAll&amp;dir=asc&quot;>Address</a></th> <th class=&quot;date sortable&quot;> <a href=&quot;Mortgages.action?sort=principalLoanBalance&amp;event=listAll&amp;dir=asc&quot;>Loan</a></th> <th></th> <th class=&quot;date sortable&quot;> <a href=&quot;Mortgages.action?sort=creationDate&amp;event=listAll&amp;dir=asc&quot;>Creation date</a></th></tr></thead> <tbody> <tr class=&quot;empty&quot;><td colspan=&quot;7&quot;>Nothing found to display.</td></tr> </tbody> </table> <input type=&quot;hidden&quot; name=&quot;__source&quot; value=&quot;/WEB-INF/jsp/ebanking/listAll.jsp&quot;/> <input type=&quot;hidden&quot; name=&quot;event&quot; value=&quot;delete&quot;/> </form> <!-- IE Column Clearing --> <div id=&quot;ie_clearing&quot;> &#160; </div> </div> </div> </div> <div id=&quot;footer&quot;> <p style=&quot;float:right&quot;>Layout based on <a href=&quot;http://www.yaml.de/en/home.html&quot;>YAML</a></p> <p>You are currently one of the 1 users browsing this demo site. - <a href=&quot;/loomdemo/about.jsp&quot; title=&quot;about this demo site&quot;>about this demo site</a></p> <p>&copy; 2007 Extrema Sistemas de Informaci&oacute;n - <a href=&quot;http://extrema-sistemas.com/en/legal&quot; title=&quot;Terms of use&quot;>Terms of use</a> - <a href=&quot;http://extrema-sistemas.com/en/contact&quot; title=&quot;Go to the contact form&quot;>Contact</a> - <a href=&quot;http://extrema-sistemas.com&quot; title=&quot;Go to Extrema home&quot;>Extrema home</a> </p> </div> </div> </div> <script src=&quot;//ajax.googleapis.com/ajax/libs/prototype/1.6.0.2/prototype.js&quot; type=&quot;text/javascript&quot;></script> <script src=&quot;/loomdemo/js/loom-1.0-SNAPSHOT/loom.js&quot; type=&quot;text/javascript&quot;></script> <script src=&quot;//ajax.googleapis.com/ajax/libs/scriptaculous/1.8.1/scriptaculous.js?load=builder,effects&quot; type=&quot;text/javascript&quot;> </script> <script src=&quot;/loomdemo/js/tips.js&quot; type=&quot;text/javascript&quot;></script> </body> </html>
  • 11.
  • 12. Connect javascript autocompleter <myapp:autocompleter name=”parent” action=&quot;Entries&quot; event=&quot;getParentCandidates&quot; />
  • 13. First attempt The server generates HTML + javascript: <input type=”text” name=”parent” id=”parent” /> <script> new Autocompleter($(“parent”), { url: “http://localhost/getCandidates.json” }) </script>
  • 14.
  • 15. The javascript code is generated by the server (inflexible)
  • 16. Some libraries must be loaded before the HTML (really bad for performance)
  • 17. Too many <script> tags (harder to debug and hurts performance)
  • 18.
  • 19.
  • 20. This is your javascript code , not generated by the server: $$('input.autocompleter').each(function(e) { new Autocompleter(e, { url: e.getAttribute('url'); }); });
  • 21.
  • 22. All javascript code is together at the end of the page or inside external javascript files
  • 23. Maximum javascript flexibility
  • 24. Cleaner code that is cacheable
  • 25.
  • 26. Test your code Javascript code should also be tested
  • 27.
  • 28. Java-driven tests: WebDriver, Selenium
  • 30.
  • 32. Dojo : D.O.H (Dojo Objective Harness)
  • 33. MooTools : Clientcide Test Framework
  • 34. YUI : YUI Test
  • 35. Others : FireUnit, TestMonkey...
  • 36.
  • 37. 2: Add javascript tests
  • 38. 3: Add test suite
  • 39. 1: Static HTML page <html> <body> <input type=”text” name=”parent” id=”foo” class=”autocompleter” url=“mock-candidates.json” /> <script> var auto = new Autocompleter($('foo'), { url: e.getAttribute('url'); }); </script> </body> </html>
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46. Open all supported browsers for the host environment
  • 47. Launch all the configured test pages
  • 48. Inform about the results
  • 49.
  • 50. Just confirm that the server generates the expected HTML contract .
  • 51.
  • 52. 2: Test HTML + flash + real javascript
  • 53. 3: Integration test
  • 54. Thanks Ignacio Coloma [email_address] http://icoloma.blogspot.com http://extrema-sistemas.com

Editor's Notes

  1. This is the typical look of an application that starts adding a couple of js features and ends up like the Loch Ness Monster. Ajax is not like XP, it should not be improvised.
  2. Cuando se elige entre REST y RIA, tener en cuenta que a una aplicación en intranet le da igual estar indexada (y otros casos como Google wave,por ser contenidos de corta caducidad), pero al resto frecuentemente le hace falta indexarse. Hay un museo en Madrid que tiene en torno al 50% de accesos desde google. Para nosotros es el 75%.
  3. Lo puedo poner en una pagina o en un script general
  4. Puedo probar manualmente con firebug Puedo modificar lo que pruebo Puedo inspeccionarlo todo Uso un fichero local