Web application Architecture

Similar documents
Performance Testing for Ajax Applications

Term Paper. P r o f. D r. E d u a r d H e i n d l. H o c h s c h u l e F u r t w a n g e n U n i v e r s i t y. P r e s e n t e d T o :

An introduction to creating Web 2.0 applications in Rational Application Developer Version 8.0

Table of contents. HTML5 Data Bindings SEO DMXzone

AJAX: Highly Interactive Web Applications. Jason Giglio.

Credits: Some of the slides are based on material adapted from

Client-side Web Engineering From HTML to AJAX

Implementing Mobile Thin client Architecture For Enterprise Application

Ajax: A New Approach to Web Applications

Smartphone Enterprise Application Integration

A Model of the Operation of The Model-View- Controller Pattern in a Rails-Based Web Server

Drupal CMS for marketing sites

Chapter 12: Advanced topic Web 2.0

Programming in HTML5 with JavaScript and CSS3

FF/EDM Intro Industry Goals/ Purpose Related GISB Standards (Common Codes, IETF) Definitions d 4 d 13 Principles p 6 p 13 p 14 Standards s 16 s 25

Experimenting in the domain of RIA's and Web 2.0

White Paper On. Single Page Application. Presented by: Yatin Patel

From Desktop to Browser Platform: Office Application Suite with Ajax

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

Some Issues on Ajax Invocation

Client-Side Web Programming (Part 2) Robert M. Dondero, Ph.D. Princeton University

Monitoring the Real End User Experience

Web Testing. Main Concepts of Web Testing. Software Quality Assurance Telerik Software Academy

CMSC434 TUTORIAL #3 HTML CSS JavaScript Jquery Ajax + Google AppEngine Mobile WebApp HTML5

Example. Represent this as XML

Web Applications: Overview and Architecture

Why AJAX? Keywords - Web applications, Java Script, Web INTRODUCTION. Why Not AJAX? 111 P a g e

Visualizing an OrientDB Graph Database with KeyLines

Front-End Performance Testing and Optimization

Adding Panoramas to Google Maps Using Ajax

Progressive Enhancement With GQuery and GWT. Ray Cromwell

Building Rich Internet Applications with PHP and Zend Framework

Visualizing a Neo4j Graph Database with KeyLines

Nexawebホワイトペーパー. Developing with Nexaweb ~ Nexaweb to Improve Development Productivity and Maintainability

Developing Offline Web Application

Overview. In the beginning. Issues with Client Side Scripting What is JavaScript? Syntax and the Document Object Model Moving forward with JavaScript

IBM Digital Experience. Using Modern Web Development Tools and Technology with IBM Digital Experience

Chapter 3: Web Paradigms and Interactivity

AJAX and JSON Lessons Learned. Jim Riecken, Senior Software Engineer, Blackboard Inc.

TCP/IP Networking, Part 2: Web-Based Control

Distance Examination using Ajax to Reduce Web Server Load and Student s Data Transfer

Rich Internet Applications

Dynamic Web Programming BUILDING WEB APPLICATIONS USING ASP.NET, AJAX AND JAVASCRIPT

Enable Your Automated Web App Testing by WebDriver. Yugang Fan Intel

MASTERTAG DEVELOPER GUIDE

Rich-Internet Anwendungen auf Basis von ColdFusion und Ajax

AJAX. Gregorio López López Juan Francisco López Panea

Learning Web App Development

Ajax Development with ASP.NET 2.0

MathCloud: From Software Toolkit to Cloud Platform for Building Computing Services

Web Cloud Architecture

What is AJAX? Ajax. Traditional Client-Server Interaction. What is Ajax? (cont.) Ajax Client-Server Interaction. What is Ajax? (cont.

Building Ajax Applications with GT.M and EWD. Rob Tweed M/Gateway Developments Ltd

Performance testing Web 2.0

ICON UK 2015 node.js for Domino developers. Presenter: Matt White Company: LDC Via

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

ORACLE MOBILE APPLICATION FRAMEWORK DATA SHEET

Web Performance. Lab. Bases de Dados e Aplicações Web MIEIC, FEUP 2014/15. Sérgio Nunes

Step One Check for Internet Connection

REST vs. SOAP: Making the Right Architectural Decision

LabVIEW Internet Toolkit User Guide

Up and Running with LabVIEW Web Services

Programming IoT Gateways With macchina.io

JavaScript Programming

How To Build A Web App

Avaya Inventory Management System

Improving Magento Front-End Performance

Power Tools for Pivotal Tracker

Google Web Toolkit. Introduction to GWT Development. Ilkka Rinne & Sampo Savolainen / Spatineo Oy

place/business fetch details, removefromfavorite () function, 189 search button handler bind, B BlackBerry build environment

English. Asema.com Portlets Programmers' Manual

Mobile development with Apache OFBiz. Ean Schuessler, Brainfood

Development and Implementation of Location Based Native Mobile Application

Website Performance: Kyle Simpson

QML and JavaScript for Native App Development

Web Programming Step by Step

4D and SQL Server: Powerful Flexibility

Mobile Performance: for excellent User Experience

Developing Cross-platform Mobile and Web Apps

Upgrade to Microsoft Web Applications

Streaming Media System Requirements and Troubleshooting Assistance

An introduction to creating JSF applications in Rational Application Developer Version 8.0

design coding monitoring deployment Java Web Framework for the Efficient Development of Enterprise Web Applications

It is highly recommended that you are familiar with HTML and JavaScript before attempting this tutorial.

Titolo del paragrafo. Titolo del documento - Sottotitolo documento The Benefits of Pushing Real-Time Market Data via a Web Infrastructure

How To Test Your Web Site On Wapt On A Pc Or Mac Or Mac (Or Mac) On A Mac Or Ipad Or Ipa (Or Ipa) On Pc Or Ipam (Or Pc Or Pc) On An Ip

Using Steelhead Appliances and Stingray Aptimizer to Accelerate Microsoft SharePoint WHITE PAPER

Client Side Binding of Dynamic Drop Downs

OAuth 2.0 Developers Guide. Ping Identity, Inc th Street, Suite 100, Denver, CO

Enterpise Mobility Lexicon & Terminology

A Tool for Evaluation and Optimization of Web Application Performance

Transcription:

2014 Cesare Pautasso 1 / 29 Very Thin Client 6 / 29 AJAX Input/ Output Prof. Cesare Pautasso http://www.pautasso.info cesare.pautasso@usi.ch Client/Server 7 / 29 @pautasso 5 / 29 Web application Architecture 8 / 29 Rich Client Client Server Backend 9 / 29 base File System General Architecture Client Server Cache 2014 Cesare Pautasso

Rich vs. Thin Client Rich Client s runs on the client (may use the server for storage) Platform Examples: Windows, MacOS/X Eclipse RCP/Java Software needs to be deployed on the client Zero latency Complete control, native access to the client platform Thin Client runs on the server, client only perform UI tasks Examples: Dumb Terminals Web 1.0 s Zero deployment/upgrade costs Cannot (yet) work offline: sensitive to network failures Limited control, sandboxed access to the client platform 11 / 29 Client/Server App Structure app.js package.json models public/css public/images public/js public/views/*.js routes views/*.dust public contains static assets downloaded and executed by the browser What about security? 12 / 29 13 / 29 Web servers should not ever run any code sent by a Web browser Web browsers use a sandbox (secure virtual machine) to run code downloaded from a Web server

Interconnect 14 / 29 Web 1.0 Architecture 16 / 29 How to connect the client with the server? Send user commands and input data as HTTP requests from the client to the server How to connect the server with the client? Pull: Fetch and refresh output data Push: Notify client about state changes Page 1 <a href= Page 2 <form action= Page 3 <a href= Click on link HTML Submit form HTML A new page must be loaded for every interaction 15 / 29 PULL PUSH Web 1.0 Architecture - Problems UI not Responsive The entire UI must be refreshed for every interaction, even if only parts of it need to be updated The browser is blocked until the new page is downloaded from the server Server unnecessarily busy rendering Web pages in HTML when it could be just sending JSON and offload the rendering to the browser 17 / 29

Web 2.0 Architecture Page 1 <onclick> <onsubmit> <onkeypress> <onmouse*> Click JSON KeyPress JSON 18 / 29 Problems Since the whole application runs in the same page: Back button, navigation history broken Needs special handling of the "UI state" of the application HTTP connections are expensive: Do not poll the server too often Browsers limit the number of parallel connections to the same server 20 / 29 Advantages User interactions are decoupled from client/server interactions When the user interacts with the application we send a JSON/XML request to the server and receive a JSON/XML response back. The HTML rendering is done on the client JSON is faster, smaller, cheaper to encode, send and decode compared with XML/HTML Clients do not have to download the entire data but can fetch the data they need when they need it 19 / 29 History Navigation history.pushstate(state, "title", URI); history.replacestate(state, "title", URI); Write a (new) entry in the browser history (associate URI with UI state) window.onpopstate = function(event) { //history state changed, synchronize the UI: document.location; document.location.hash; //#URI fragment event.state //UI state object ; React to navigation along the history (back/forward) history.back(); history.forward(); Programmatically navigate along the history 21 / 29

AJAX 22 / 29 Synchronous Interaction 23 / 29 AJAX combines different technologies: HTML5 and CSS in the display Dynamic display and interaction with DOM interchange and manipulation using XML/XSLT (JSON) Asynchronous data retrieval with XMLHttp Javascript binding everything together The user waits for the server to process each request Asynchronous Interaction 24 / 29 UI AJAX The UI thread is never blocked since server interactions run in the background

XMLHttp (GET, Synch) 25 / 29 XMLHttp (POST, Asynch) 27 / 29 function GET(url) { var r = new XMLHttp(); r.open("get", url, false); false = synchronous r.send(null); //this will continue after the response has arrived if (r.status == 200) responsetext contains return r.responsetext; the JSON string to be else parsed //handle error XMLHttp (GET, Asynch) function GET(url, callback) { var r = new XMLHttp(); r.open("get", url, true); true = asynchronous r.onreadystatechange = function() { if (r.readystate == 4) { readystate if (r.status == 200) 0 uninitialized callback(r.responsetext); 1 opened else 2 sent //handle error 3 receiving 4 complete r.send(null); //this will continue immediately 26 / 29 function POST(url, params, callback) { var r = new XMLHttp(); r.open("post", url, true); r.onreadystatechange = function() { if (r.readystate == 4) { if (r.status == 200) callback(r.responsetext); r.setheader("content-type", "application/x-www-form-urlencoded"); r.send(params); //this will continue immediately References Gottfried Vossen, Stephan Hagemann, Unleashing Web 2.0 From Concepts to Creativity, Morgan Kaufmann, 2007 Paul Graham, applications) (http://www.paulgraham.com/road.html), September 2001. Adam Bosworth, Jesse James Garrett, (http://www.eweek.com/c/a/it-infrastructure/googles-bosworth-why- AJAX-Failed-Then-Succeeded/), Jan 2007 (http://www.adaptivepath.com/ideas/ajax-new-approach-webapplications), Feb 2005 Tim O'Reilly, The Other Road Ahead (On the advantages of Web Why AJAX Failed (Then Succeeded) Ajax: A New Approach to Web s What Is Web 2.0 - Design Patterns and Business Models for the Next Generation of Software (http://oreilly.com/web2/archive/what-is-web-20.html), Sept 2005 28 / 29