270 likes | 429 Views
Ajax!. Ajax Programming. Take A Scenario. Take a look at a typical desktop application (Spreadsheet app, etc.) The program responses intuitively and quickly The program gives a user meaningful feedback's instantly Things happen naturally. Conventional Web Apps.
E N D
Ajax! Ajax Programming
Take A Scenario • Take a look at a typical desktop application (Spreadsheet app, etc.) • The program responses intuitively and quickly • The program gives a user meaningful feedback's instantly • Things happen naturally
Conventional Web Apps • “Click, wait, and refresh” user interaction • Synchronous “request/response” communication model • Page-driven: Workflow is based on pages
Conventional Web Apps Issues • Interruption of user operation • Loss of operational context during refresh • No instant feedback's to user activities • Constrained by HTML • These are the reasons why Rich Internet Application (RIA) technologies were born.
RIA Technology • Applet (Swing) • Macromedia Flash • Java WebStart • AJAX
Applet • Pros: • Can use full Java APIs • Custom data streaming, graphic manipulation, threading, and GUIs • • Cons: • Code downloading time • Reliability concern - a mal functioning applet can crash a • browser
Macromedia Flash • Designed for playing interactive movies originally • • Pros: • Good for displaying vector graphics • • Cons: • Browser needs a Flash plug-in • ActionScriptis proprietary
Java Webstart • Pros • Desktop experience once loaded • Leverages Java technology to its fullest extent • Disconnected operation is possible • Application can be digitally signed • Incremental redeployment
Java Webstart • • Cons • Old JRE-based system do not work • First-time download time could be still significant
AJAX • Asynchronous Javascript and XML. • Not a stand-alone language or technology. • It is a technique that combines a set of known technologies in order to create faster and more user friendly web pages. • It is a client side technology.
AJAX vs Flash • No plugin for AJAX • Flash development tools cost money • Flash typically has slower page load time • Flash can work on older browsers
AJAX vs Flash • ActionScript doesn't have a cross browser issues • Flash can access other domains if there is a crossdomain.xml file
AJAX • Pros • Most viable RIA technology so far • Tremendous industry momentum • Several toolkits and frameworks are emerging • No need to download code & no plug-in required • Cons • Still browser incompatibility • JavaScript is hard to maintain and debug
AJAX Purpose • Prevents unnecessary reloading of a page. • When we submit a form, although most of the page remains the same, whole page is reloaded from the server.
AJAX Purpose • This causes very long waiting times and waste of bandwidth. • AJAX aims at loading only the necessary innformation, and making only the necessary changes on the current page without reloading the whole page.
Why AJAX? • Intuitive and natural user interaction • No clicking required • Mouse movement is a sufficient event trigger • "Partial screen update" replaces the "click, wait, and refresh" user interaction model • Only user interface elements that contain new information are updated (fast response)
Why AJAX? • Data-driven (as opposed to page-driven) • UI is handled in the client while the server provides data • Asynchronous communication replaces "synchronous request/response model." • A user can continue to use the application while the client program requests information from the server
Why AJAX is Popular • Google helped popularize • Increase Usability of Web Applications • Rich Internet Applications without Flash • Save Bandwidth • Download only data you need • Faster interfaces (sometimes)
Technology of AJAX • JavaScript/PHP • HTML • CSS • XML • JSP
Real Life AJAX Example • Google Map • Gmail • NetFlix.com • Flickr • Worklife Survey (old tooltip) • MUSE Calendar (Ajax tooltip) • www.2locals.com (Ajax) • And many other popping anywhere
End “To better understand the concepts of AJAX we need to ==activate== your creativity”
Group Activity: In a creative role playing, think of REAL LIFE good scenarios that will show the concepts of AJAX such: the interaction of different components comparison to classic web Etc…… Note: It’s your cooperation matters; collaborate.