Documente Academic
Documente Profesional
Documente Cultură
E)
C.S.E)
combines functionality or content from existing sources. The existing source used in mashups is typically sourced from a third party via a public interface or API. Other methods of sourcing content for mashups include Web feeds (e.g. RSS ) and JavaScript.
SERVICE
SOAP
RSS
Enterprise
Mash
Excel
JSON
Publish
Consume
REST Web 1.0
POX
Supply Side
Build a Better Web Interface Using Mashup
Web2.0
Consumpti on Side
Web Services:
A new way of reuse/integrate third party software or legacy system No matter where the software is, what platform it residents, or
which language it was written in Based on XML and Internet protocols (HTTP, SMTP)
Benefits:
Ease of integration Develop applications faster
XML) The response of remote service can be in XML or any textual format Benefits: Easy to develop Easy to debug (with standard browser) Leverage existing web application infrastructure
Continued
Really Simple Syndication (RSS)
XML-based standard Designed for news-oriented websites to Push content to readers
mashup, although you can still find it in use if you look hard enough.
IFrame
IFRAME is a mini-browser window in an HTML document Can be hidden (0 width, 0 height) IFRAME can call a URL Hears a click as server submits request Much slower than XMLHTTPRequest
Example:
Housing Maps downloads Craigs List data
Downloads XML data, publishes static JavaScript on a schedule Expert programmers needed to set this up
Google Maps
Craigs List
Build a Better Web Interface Using Mashup
housing maps
10
Example :
www.housingmaps.com combines Google Maps data with
Deconstructing a Mashup
(Housingmaps.com) that is distinct from both the source web site (Craigslist) and the destination application (Google Maps). Data is drawn from the source and
and XML.
3) Mashing in the browser using JSON.
Build a Better Web Interface Using Mashup
and XML.
3) Mashing in the browser using JSON.
Build a Better Web Interface Using Mashup
How It Works
1. The Web browser communicates with the server, requesting a
page using straight HTTP or HTTPS. 2. That page is constructed by the Web server, which reaches out
4. The second request in this example is to Yahoo using a Representational State Transfer (REST) style approach. 5. Yahoo responds with Plain Old XML over HTTP. 6. Lastly, the Web server aggregates the responses, combining and rationalizing the data in whatever manner makes sense.
and XML.
3) Mashing in the browser using JSON.
Build a Better Web Interface Using Mashup
What is AJAX?
AJAX == Asynchronous JavaScript and XML
refers to the ability of a browser to request data from the server in the background (asynchronously)
Ajax is a technique for creating better, faster, more responsive web applications
together, including
HTML/XHTML CSS JavaScript DOM XML
Build a Better Web Interface Using AJAX
This is faster because less data is transmitted and because the browser has less work to do.
request.send(content);
This is the version you use with a POST request The content has the same syntax as the suffix to a GET request POST requests are used less frequently than GET requests
This is a function assignment, not a function call When the function is called, it will be called with no parameters
function someFunction() {
0 1 2 3 4
Build a Better Web Interface Using AJAX
The request is not initialized The request has been set up The request has been sent The request is in process The request is complete
Classic Model
The classic web application
interface trigger an HTTP request back to a web server. The server does some processing retrieves data, crunches numbers, talks to various legacy systems And then returns an HTML page to the client
Classic Model
This approach makes a lot of technical sense, but it doesnt
Ajax Model
An Ajax application eliminates the start-stop-start-stop nature of interaction on the Web
The Ajax engine allows the users interaction with the application to happen asynchronously, independent of communication with the server
The web server sends web-page to client; this happens on all web server platforms. Build a Better Web Interface
Using AJAX
Note how small the data response is. Im displaying how the server only sends a piece of data back and not an entire web page with header and etc
This is a complete AJAX request. Programmers will have to use JavaScript and CSS to control display and or how you present the data Build a Better Web Interface returned if at all. Using AJAX
Time
Processing
Processing
Server
Build a Better Web Interface Using AJAX
Time
Server
Build a Better Web Interface Using AJAX
39
applications such as Flickr, Google ,Maps, and Gmail, you can turn off JavaScript in your browser and see what changes in the behavior of the application. To turn off JavaScript in your browser, do the following, depending on which browser youre using: In Firefox, uncheck Tools Options Content Enable JavaScript. In Internet Explorer, check Tools Internet Options Security
http://flickr.com/photos
All the buttons on top of the picture no longer
function. Instead of clicking the title, description, and tags to start editing them, you have to click a link (Edit Title, Description,and Tags) before doing so.
http://google maps.com With JavaScript turned off, you no longer see the pan
and zoom new-style maps but an old-style map that provides links to move north, south, east, or west or to change the zoom level.
How It Works
1. As before, the sequence begins with the browser requesting a page from the Web server. That page is
3. The next step is for the browser to issue a request back to the server for additional content. This might be a SOAP
4. The server in this case is acting as a proxy. The browser has asked for some content, perhaps a stock quote from
9. Some mashing may occur on the server. This is really an optional step because the data might just be sent directly back to the browser. 10. Once the data is ready, its sent back to the browser. Meanwhile, back at the browser, life has moved on. A JavaScript callback function that was named
How It Works
Most JSON mashups make use of an approach known as the Dynamic Script method. It follows a flow similar to the
following:
1. As always, the flow starts with a browser request for a page using HTTP GET.
2. A page is served by the Web server that contains a couple of key JavaScript functions: a. Aparsing function expects a JavaScript object as a parameter. This function examines the object passed into it and inserts the data contained in the object into the HTML of the page. b. An initiation script is the genius of the Dynamic Script
method. It adds a new script tag to the page, and specifies the
source for that script tag as being a URL at some partner site (for example, Amazon.com). That URL will render not
3. The browser attempts to load the source code for the new script tag. 4. By loading the script, an HTTP GET request is made out to Amazon (or whatever the source was). 5. The partner site (in this case, Amazon) responds with a JavaScript object serialized into JSON
notation.
Build a Better Web Interface Using AJAX
6. This JSON script becomes wrapped in a function call to the render function, and the entire JavaScript blob becomes
page.
Advantage
The main benefit with the JSON approach is communication path. The browser communicates directly with the partner site with no need to go through the server. As a result, load on the server is reduced because the browser is in charge
of the communication.
Build a Better Web Interface Using AJAX
Tools Available
Yahoo! Pipes
Microsofts Popfly Marmite Dapper Google mashup editor
Mashmaker
IBM Mashup Center
craigslist
Unlikely to have APIs
Have APIs
Examples of Mashups
Housing Maps http://housingmaps.com JavaScript mashup of Google Maps and rental data from Craigs List Chicago Crime http://chicagocrime.org JavaScript Mashup of Google Maps and Chicago crime statistics
Google Flight Simulator http://www.isoma.net/games/goggles.html Flash mashup of Google Maps and an airplane video game
Sample APIs
http://api.flickr.com/services/rest/?method=flickr.test
.echo&api_key={api-key} http://api.shopping.yahoo.com/ShoppingService
Conclusions
Mashup environments target different user groups
exchange formats and provide blocks for every service that user is likely to integrate.
Advanced functionality will keep environments on the
Questions?