13.07.2015 Views

Thesis full text PDF - Politecnico di Milano

Thesis full text PDF - Politecnico di Milano

Thesis full text PDF - Politecnico di Milano

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

developers as a “serious programming language,” despite the fact that, in reality, it’s a <strong>full</strong>yfeatured, dynamic language capable of supporting object-oriented programming methodologies.The misperception of JavaScript as a “toy language” is now changing rapidly as AJAXdevelopment techniques expand the power and functionality of browser based applications. As aresult of the advent of AJAX, JavaScript now seems to be undergoing something of arenaissance, and the explosive growth in the number of JavaScript toolkits and libraries availablefor AJAX development is proof of the fact.Server-Side ScriptingThe server is still required to perform tasks like data persistence and input validation. However,in some Ajax architectures, it no longer performs any duty of <strong>di</strong>splay or application logic, leavingthose things for the browser script to handle.Event Model (“DHTML”)The event model allows JavaScript to respond to events such as mouse clicks. This is the key tomake interactive a conversation between the user and the web site, within the browser.Web RemotingWeb Remoting is the ability of JavaScript to talk <strong>di</strong>rectly with the server, no page refresh isrequired. XMLHttpRequest dominates most of the headlines, but there are actually several viableremoting technologies.2.2.4. Ajax versus the Tra<strong>di</strong>tional approachWith Ajax, instead of having to send everything to the server in a single, huge mass, then waitfor the server to send back a new page for rendering, web developers can communicate with theserver in smaller chunks, and selectively update specific areas of the page based on the server’sresponses to those requests. This is where the word asynchronous in the AJAX acronymoriginated. It’s probably easiest to understand the idea of an asynchronous system byconsidering its opposite, a synchronous system. In a synchronous system, everything occurs inorder. If a car race was a synchronous system, it would be a very dull affair. The car that startedfirst on the grid would be the first across the finish line, followed by the car that started second,and so on. There would be no overtaking, and if a car broke down, the traffic behind would beforced to stop and wait while the mechanics made their repairs.Tra<strong>di</strong>tional web apps use a synchronous system: you must wait for the server to send you thefirst page of a system before you can request the second page, as shown in Figure 1.1.14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!