Скачать презентацию Copyright 2006 Roger L Costello Timothy D Скачать презентацию Copyright 2006 Roger L Costello Timothy D

becf17f7c1038e32cd5ffdc4dd587d58.ppt

  • Количество слайдов: 158

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 1 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 1 The Web Paradigm Shift The Heretical Guide to Designing Web Services by Roger L. Costello and Timothy D. Kehoe 1 Last Updated: May 20, 2006

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 2 CONTENTS Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 2 CONTENTS 1. 2. 3. 4. 5. 6. 7. Web Basics The Web Paradigm Shift 7 Laws of Web Service Design Case Study: Implementing Priorities Logical URLs, Physical URLs, Resources and Representations Links and the Structure of Knowledge Guidance, Do's and Don'ts 7. 1 Net-centric XML 7. 2 "Getting Information" versus "Doing Things" 7. 3 Characterizing Good Web Services 7. 4 Characterizing Good Web Documents 8. Closing Remarks 2

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 3 What Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 3 What is a Web Service? A Web Service is a software implementation of a resource, identified by a URL, reached using internet protocols. 3

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 4 Web Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 4 Web Basics* * For an excellent introduction to Web basics, check out this book: HTTP Essentials by Stephen Thomas from Wiley Computer Publishers. 4

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 5 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 5 The Web information The Web is a network of information that can be traversed in many ways. 5

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 6 Paths Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 6 Paths to Information 6

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 7 What’s Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 7 What’s in a Name? http: //www. cnn. com/2006/01/11/implosion. ap/index. html The resource that we are after. The host that holds what we want. The scheme identifies the protocol that is to be used; in this example, the Hyper. Text Transfer Protocol. There are 51 other schemes, among them - https (Hyper. Text Transfer Protocol Secure) - ftp (File Transfer Protocol) - urn (Uniform Resource Names) HTTP (version 1. 1) is by far the most commonly used scheme. For all practical purposes, HTTP 1. 1 is the "Web Protocol. " 7

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 8 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 8 The Web API • HTTP provides a simple set of operations. Amazingly, all Web exchanges are done using this simple HTTP API: – – GET = "give me some stuff" (Retrieve) POST = "here's some better stuff" (Update) PUT = "here's some new stuff" (Create) DELETE = "delete that stuff" (Delete) • A few simple rules allow you to create tremendous complexity. 8

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 9 Retrieving Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 9 Retrieving Information 1 Client GET URL Server data + status code 2 The server responds with, not only the data (the Web page), but also a result code (200 means everything is OK) 9

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 10 HTTP Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 10 HTTP GET http: //www. cnn. com/US_News GET /US_News HTTP/1. 1 Host: www. cnn. com CNN Server - The user types in at his browser: http: //www. cnn. com/US_News - The browser software creates an HTTP header - The HTTP header identifies: - The desired action: GET ("get me some stuff") - The target machine (www. cnn. com) - The resource (US_News) 10 - The version of HTTP being used (version 1. 1)

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 11 Updating Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 11 Updating Information 1 Client POST URL + data Server data + status code 2 The client provides information. The server responds with a result code (200 means everything is OK) 11

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 12 Change Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 12 Change of Address Form HTTP POST Street: 91 Tremont St. City: Boston State: MA Zip: 01710 SUBMIT POST /customer/john_doe/address HTTP/1. 1 Host: www. chase. com Street Address: 91 Tremont St. City: Boston State: MA Zipcode: 01710 Chase Server • The user fills in the Web page's form (Chase Bank's Change of Address Form) • The browser software creates an HTTP header, and a payload which is comprised of the form data - The HTTP header identifies: - The desired action: POST ("here's my new address") - The target machine (www. chase. com) - The resource (customer/john_doe/address) - The payload contains: 12 - The data being POSTed (the form data)

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 13 Providing Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 13 Providing Information 1 Client PUT URL + data Server data + status code 2 POST is used to update existing information on the server. 13 PUT is used to make new information available on the server.

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 14 Removing Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 14 Removing Information 1 Client DELETE URL Server data + status code 2 The client requests that the server remove information identified by the URL. Typically a server will return an acknowledgement that it has deleted the requested data. 14

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 15 Basic Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 15 Basic Web Components • Firewalls and Proxy Filters: these components decide what HTTP messages get out, and what get in. – These components enforce Web security. • Routers: these components decide where to send HTTP messages. – These components manage Web scaling. • Caches: these components decide if a saved copy can be used. – These components increase Web speed. 15

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 16 Firewalls Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 16 Firewalls and Proxy Filters POST /personals/Sallys. Porn. Shop HTTP/1. 1 Host: www. geocities. com Item: Sally in lingerie Credit Card: Visa Number: 1234 -5678 -9012 -6789 Expiry: June 2006 Item: Sally in lingerie Credit Card: Visa Number: 1234 -5678 -9012 -6789 Expiry: June 2009 – The proxy filter decides whether an HTTP message should pass – This message is rejected! PROXY FILTER ("Should I allow POSTing to Sallys. Porn. Shop? ") Proxy Filter Rules & Policies Prohibit all POSTs to the Sallys. Porn. Shop Web site. 16

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 17 Routers Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 17 Routers Source host PC Packet To: Destination host (Protocol address) Router 1 (Physical address) Packet Router 1 To: Destination host (Protocol address) Router 2 (Physical address) Router 2 To: Destination host (Protocol address) Router 3 (Physical address) Router 3 Packet To: Destination host (Protocol address) Destination host (Physical address) Destination host PC Packet 17 http: //www. cisco. com/univercd/cc/td/doc/cisintwk/ito_doc/routing. html

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 18 Caches Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 18 Caches 2 1 First access, goes all the way back to the server with the data (origin server) Next access, the cache returns the data. GET Server Cache Client data + status code 4 data + status code 3 5 GET Cache Client data + status code 6 Server 18

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Proxy Filters Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Proxy Filters and Caches Operate using only Information found in the HTTP Header! HTTP Header eck h C HTTP Payload ! his t Component (proxy filter, cache) Web Message Firewalls and routers use lower-level information, such as IP addresses. 19 19

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 20 Header Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 20 Header and Payload Change of Address Form Street: 91 Tremont St. City: Boston State: MA Zip: 01710 SUBMIT This information (the HTTP data) is called the HTTP header POST /customer/john_doe/address HTTP/1. 1 Host: www. chase. com Street Address: 91 Tremont St. City: Boston State: MA Zipcode: 01710 Chase Server This information (the form data) is called the payload. 20

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 21 Reasons Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 21 Reasons for Basing Decisions Solely on the HTTP Header • The content of the HTTP header is well-defined (standard semantics). • Conversely, the HTTP payloads change from request to request. • Web components cannot make sense of all the different kinds of information that may occur in payloads. Web components never peek inside the message payload. 21

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 22 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 22 Summary • • The web is all about information sharing. URL’s identify information on the Web. HTTP is the predominate protocol on the Web. HTTP provides a very simple API: – GET, POST, PUT, DELETE • The Web's basic components operate by examining the HTTP header – Firewalls, proxy filters, caches, routers 22

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 23 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 23 The Web Paradigm Shift 23

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 24 Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 24 "The Web is a paradigm shift" - Tim Berners-Lee, W 3 C Chairman Symposium, Nov. 2005 What is a paradigm shift? What is the paradigm shift that he refers to? 24

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 25 Scientific Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 25 Scientific progress has not been a steady, forward movement toward knowledge. Better characterized as a series of peaceful interludes punctuated by intellectually violent revolutions (Copernicus, Darwin, Freud). In time, and with difficulty, a new conceptual view replaces the old. When the new framework replaces the old, we look at the world through the context of this new framework. We reframe the problems and pose new solutions using new tools. This is when a paradigm shift occurs. 25

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 26 Programming Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 26 Programming Paradigm Shift • Structured programming first appeared with ALGOL in ~1960 – emphasized a top-down approach to coding algorithms, – divided a program into "intellectually manageable programs" [Dijkstra], – employed limited control structures that repeatedly invoke subtasks in the form of subroutines. • Structured programming was a paradigm shift meant to correct disorganized programming practices endemic in assembly-level programming. 26

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 27 Programming Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 27 Programming Paradigm Shift • Object-oriented programming began in 1980 with Smalltalk and the dawning of the OO methodology – emphasized data and its state, wrapped in an object, – manipulated object state through messaging, – defined relations through inheritance. • Object-oriented programming was a paradigm shift meant to add data management to the practices inherited from procedural programming. 27

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 28 Programming Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 28 Programming Paradigm Shift • Web programming challenges us to make still another paradigm shift – – model information as resources identified by URLs implement tasks through the exchange of information link to information rather than embed information create loose networks of information rather than rigid taxonomies – traverse information in user-defined ways, rather than through preset paths 28

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 29 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 29 The Web Paradigm: Information Exchange • • GET: "give me some information" POST: "here's some updated information" PUT: "here's some new information" DELETE: "delete that information" information Server What "actions" the server performs to generate the output information are opaque to the client. Client information 29

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 30 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 30 The Web Paradigm: a Network of Linked Information The latest news in Iraq is not good. Five more US army. . . Observe that the information can come in many different formats - text, audio, 30 video, and others.

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 31 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 31 Summary • The Web paradigm is one of – exchanging information with a resource identified by a URL – linking to information, rather than embedding information – traversing information in user-defined ways, rather than through preset paths – networks of information rather than neat taxonomies • The Web is a collection of highly interconnected information, that may be processed in many different ways. 31

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 32 7 Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 32 7 Laws of Web Service Design 32

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 33 7 Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 33 7 Laws of Web Service Design 1. Resources: Primal Elements of the Web 2. URLs: Identify every Resource 3. Content Types: Adaptability and Survival on the Web 4. Information Exchange: Trade Documents, not Arguments 5. Links: Connect, don't Encapsulate 6. Payload versus Protocol: The Right Information in the Right Place 7. Viewpoints: Information from Any Perspective, in any Direction 33

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 34 Resources Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 34 Resources Primal Elements of the Web • Resources are the basic building blocks of the Web. • Every activity on the Web is one of Creating, Retrieving, Updating and Deleting (CRUD) resources. • A resource is a conceptual entity. 34

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 35 A Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 35 A Resource is a Conceptual Entity • Consider "information". It is an abstract, conceptual thing. It is concretely "represented" in many different forms - in text form, in audio form, in pictorial form. • Likewise, a resource is an abstract, conceptual thing. It is concretely "represented" in many different forms - in HTML form, in XML form, in MP 3 form, in MPEG form. 35

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 36 Identifying Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 36 Identifying Resources • Identify the resources in the below description of the Boston airport. • The resources are: – – – The Boston airport, BOS Airplane with tail number FX 12 Airplane with tail number BA 99 Route BOS-LAX Route BOS-ALT The Boston airport (BOS) has these airplanes (tail number): FX 12 and BA 99. FX 12 flies this route: BOS-LAX. BA 99 flies this route: BOS-ALT. 36

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 37 Boston Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 37 Boston Airport Resources BOS BA 99 FX 12 BOS-ALT BOS-LAX Note: a circle is used to depict a resource 37

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 38 URLs Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 38 URLs Identify every Resource • The Web is all about resources. If you can't address a resource, you can't do anything with it! • Law: Identify each resource with a URL. • This law is fundamental to the Web that Tim Berners-Lee calls it Web Design, Axiom 0. • Benefits: – Individually reachable resources are discoverable by search engines (think Google). – Individual resources may have individualized 38 metadata for cataloging.

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 39 Web Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 39 Web Design, Axiom 0 (Tim Berners-Lee, director of W 3 C) • Axiom 0: all resources on the Web must be uniquely identified with a URI. URL 1 resource 1 URL 2 resource 2 URL 3 resource 3 39

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 40 Identify Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 40 Identify the Airport Resources with URLs http: //www. airport. Inc. com/airport/bos BOS http: //www. airport. Inc. com/airport/bos/airplane/ba 99 BA 99 http: //www. airport. Inc. com/airport/bos/airplane/ba 99/route/bos-alt BOS-ALT http: //www. airport. Inc. com/airport/bos/airplane/fx 99 http: //www. airport. Inc. com/. . . fx 99/route/bos-lax FX 12 BOS-LAX 40

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 41 Content Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 41 Content Types Adaptability and Survival on the Web • In nature, variety breeds adaptation which means survival. • Many different types of clients use the Web and require information in different "representations". • Representations are expressed through content type (MIME). – HTML, GIF, JPEG, XML, MP 3, MPEG, SVG, Text, CSS, SOAP • A web service lives in an ecosystem, serving many different types of clients, and therefore must work with information in a representation matched to each. • The more content types a web service offers, the more clients can use the service; that variety breeds adaptation which means survival. * 41 * Corollary: A web service that offers only one content type is destined for extinction.

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 42 Resources Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 42 Resources and Representations • A resource is a conceptual entity, but the contents you work with are real. • Issue a URL to a resource and you get back a (real) representation of it. • The power of the URL Web comes from resource navigating through representation conceptual resources (w/ MIME type) but working with real representations. 42

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 43 Example Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 43 Example of Resource and Representation Browser Client http: //www. aircrafts. Inc. com/boeing 747 Boeing 747 Aircraft Fuel requirements Maintenance schedule. . . Boeing 747. html The Client invokes a Web resource by issuing its identifier (URL). A representation of the resource is returned (in this case as an HTML document). What content type (MIME) type should a resource return? Answer: the type selected is "dynamically based on the capabilities or desires of the recipient and the nature of the resource. " (Roy Fielding) 43

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 44 Content Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 44 Content (MIME) Types Thriving in the Web Ecosystem Today Common Name MIME Type HTML Text XML SOAP GIF CSS SVG JPEG MPEG … text/html text/plain application/xml application/soap+xml image/gif text/css application/svg+xml image/jpeg video/mpeg … There are over 350 content types Obsessing over a specific representation does not serve us well 44

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 45 Information Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 45 Information Exchange Trade Documents, not Arguments • The Web is a new programming environment. • The challenge of the Web is to think in terms of information exchange with resources. • On the Web you work with resources in the form of documents with specific content types. • The architectural principles underlying the scalability of the Web dictate that documents avoid information specific to the intended processing, the destination service, or other details of implementation. 45

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 46 Can Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 46 Can we Cross the Bridge? Structured programming taught us to break a problem into logical units of code (subroutines). OOP introduced the manipulation of objects in place of blocks of processing. Resources, information exchange, content types, URLs Programming the Web 46

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 47 Coupling Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 47 Coupling versus Loose Coupling Client Calc. Route (BOS, LAX, ATL) -- data --. Subroutine Calc. Route arguments: starting-point, ending-point waypoint-list. . . • Contains process-specific info, e. g. , - the name of the subroutine (Calc. Route) • It couples the client to the web service. • Tainted by prior experience with OO and structured programming. resource A Client -- data --. resource B Documents free of processing-specific information. • client and service can evolve independently • the document (data) can be used by other services • the document (data) can be used in unanticipated ways 47 It enables the system to scale

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 48 Links Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 48 Links Connect, don't Encapsulate • Links enable a scalable, loosely coupled network of information. • Links facilitate easy, quick assembly of information. • Changes to document content instantly propagate to any document that references to it. • The relations implied by links are themselves information. • Don't embed information. Link to information! 48

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 49 Link Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 49 Link to Fuel and Maintenance Browser Client http: //www. aircrafts. Inc. com/boeing 747 Boeing 747 Aircraft Fuel requirements Maintenance schedule. . . Boeing 747. html The Web paradigm is networks of information. Thus, the representation doesn't embed the fuel and maintenance data, it links to it. 49

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 50 Payload Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 50 Payload versus Protocol The Right Information in the Right Place • The payload is the body of the message and is specific to the transaction. • The protocol is the header of the message and is general information for the transport. • By design, information in the payload is hidden. Application-specific information should be placed in the payload. • By design, information in the header is visible to all. Information applicable to the Web community at large should be placed in the header. 50

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 51 This Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 51 This information (the HTTP data) is called the HTTP header Aircraft: F 117 Callsign: Chrome Tail Number: FX 103 Pilot: Adam Vincent Terminology: Header and Payload POST / HTTP/1. 1 Host: http: //tbmcs. centcom. af. mil Aircraft: F 117 Callsign: Chrome Tail Number: FX 103 Pilot: Adam Vincent eck Ch is! th Component (proxy filter, cache) Flight Planner Web Service This information (the form data) is called the payload. 51

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 52 Vantage Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 52 Vantage Points Information in every Direction • The Web doesn't have a first page, last page, sections or chapters. It's not a tree with leaves descending from a root. • The Web allows you to jump into its huge collection of information at any point. • You land at a web site. You examine the links. You choose a link. This defines your root, your viewpoint, your organizing principle. • Unlike taxonomies, which define single viewpoints, the Web embraces many organizations of information. • Designing information resources is not a matter of deciding on the right hierarchy or organization, but ensuring that links exists for all meaningful relationships between individual elements of information. 52

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 53 Airport Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 53 Airport Ground Crew has this Viewpoint ("a plane flies a route") BA 99 BOS-ALT FX 12 BOS-LAX 53

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 54 Pilot Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 54 Pilot has this Viewpoint ("a route flown by a plane") BOS-ALT BA 99 BOS-LAX FX 12 Links enable both viewpoints! 54

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 55 Link Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 55 Link in Directions that may not Fit your Mental Model Plane: BA 99 BOS-ALT. html Suppose that you are a member of the airport's ground crew. Your mental model is that "an airplane flies a route". Thus, in the information for a route you may be tempted to just provide information about the route. Resist the temptation! Insert a link to the plane that flies the route. It will support other mental models, e. g. , the pilots. 55

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 56 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 56 Summary • Resources are the entities (resources) that you want your clients to access and manipulate. • URL’s uniquely identify each resource. • Content types integrate resources with the whole web -- a resource must be ready to respond to a client with a representation of an appropriate content type. • Information exchange: avoid processing-specific information in web documents. • Links create a network of information. • Payload versus protocol puts network-specific information in the HTTP header and application-specific information in the payload. • Viewpoints enable resources to be traversed in whatever fashion makes sense to clients. 56

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 57 Case Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 57 Case Study Implementing Priorities 57

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Case Study: Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Case Study: Airline Reservation Service • Suppose that an airline wants to create a telephone reservation system for customers to call in and make flight reservations. • The airline wants to ensure that its premier members get immediate service, its frequent flyer members get expedited service and all others get regular service. • There are two main approaches to implementing the reservation service. . . 58 58

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 59 Approach Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 59 Approach 1 "Press 1 for Premier, Press 2 for…" The airline provides a single telephone number. Upon entry into the system a customer encounters an automated message, "Press 1 if you are a premier member, press 2 if you are a frequent flyer, press 3 for all others. " Premier Customer Representative Premier Members Airline Reservations Answering Machine F. F. Customer Representative Frequent Flyer Members Regular Customer 59 Representative

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 60 Approach Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 60 Approach 2 Telephone Numbers are Cheap! Use Them! The airline provides several telephone numbers - one number for premier members, a different number for frequent flyers, and still another for regular customers. 1 -800 -Premier Customer Representative Premier Members 1 -800 -Frequent F. F. Customer Representative Frequent Flyer Members 1 -800 -Reservation Regular Members Regular Customer Representative 60

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 61 Discussion Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 61 Discussion • In Approach 1 the answering machine introduces an extra delay, which is particularly annoying to premier members. • With Approach 2 there is no intermediate step. Premier members get instant pickup from a customer service representative. Others may have to wait for an operator. 61

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 62 Web-Based Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 62 Web-Based Reservation Service • Suppose now the airline (airline. Inc. com) wants to provide a Web reservation service for customers to make flight reservations through the Web. • Just as with the telephone service, the airline wants to ensure that its premier members get immediate service, its frequent flyer members get expedited service, all others get regular service. • There are two main approaches to implementing the Web reservation service. The approaches are analogous to the telephone service. . . 62

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 63 Approach Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 63 Approach 1 One-Stop Shopping The airline provides a single URL. A web service is responsible for examining incoming client requests to determine their priority and process them accordingly. client Premier Customer Premier Members client Frequent Flyer Members Web Reservation Service Determine Priority F. F. Customer Regular Customer client Regular Members 63

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 64 POST Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 64 POST / HTTP/1. 1 Host: www. airline. Inc. com Destination: premier This POST is accepted! (but it shouldn't be) PROXY FILTER Problem with Hiding Multiple Resources behind a Single URL Premier Customer Web Reservation Service One URL for all services F. F. Customer Regular Customer Proxy Filter Rules & Policies Prohibit all POSTs to the premier service 64

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 65 Approach Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 65 Approach 1 Disadvantages • One URL hides multiple resources: – Web components can't do their job since the actual destination is hidden in the payload (Web components only examine the header). – Search engines have access to only one URL. Thus, search metadata is for only one URL. • There is currently no industry accepted practice (rules) for expressing priorities, so rules would need to be made. The clients must learn the rule, and the web service application must be written to understand the rule. – Changing priorities may require the client to make changes in his software. • This approach is based upon the incorrect assumption that a URL is "expensive" and that their use must be rationed. • The web service is a central point of failure. It is a bottleneck. Load balancing is a challenge. • It violates Tim Berners-Lee Web Design, Axiom 0. 65

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Approach 2: Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Approach 2: 66 URLs are Cheap! Use Them! The airline provides several URLs - one URL for premier members, a different URL for frequent flyers, and still another for regular customers. http: //www. airline. Inc. com/reservations/premier client Premier Members http: //www. airline. Inc. com/reservations/frequent-flyer client Frequent Flyer Members http: //www. airline. Inc. com/reservations/regular client Regular Members Premier Member Reservation Service Frequent Flyer Reservation Service Regular Member Reservation Service 66

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 67 Approach Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 67 Approach 2 Advantages • Web components (e. g. , proxy filters) can properly function since the target resources are visible in the HTTP header. • The different URLs are discoverable by search engines. • It's easy to understand what each service does simply by examining the URL, i. e. , it exploits the Principle of Least Surprise. • There is no need to introduce rules. Priorities are elevated to the level of a URL. "What you see is what you get. " – The client can change priority simply by changing to a new URL. • It's easy to implement high priority - simply assign a fast machine at the premier member URL. • There is no bottleneck. There is no central point of failure. 67 • Consistent with Axiom 0.

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 68 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 68 Summary • URLs are cheap, use them! • Don't hide multiple resources behind a single URL. 68

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 69 Logical Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 69 Logical URLs, Physical URLs, Resources, and Representations 69

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 70 Representation Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 70 Representation and Reality • Foucault was playing with the distinction between a reality and its representation. • It is important to understand the difference between a resource and its representation when modeling on the Web. 70

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 71 Representation Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 71 Representation and Reality • Another example to demonstrate the distinction between a reality and its representation. 71

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 72 Physical Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 72 Physical URLs • A physical URL contains a reference to either: – An implementation • Example: http: //www. airline. Inc. com/servlet/747 – This URL indicates a specific implementation technology, Java servlets. – A specific content (MIME) type • Example: http: //www. camera. com/cannon. html – This URL indicates a specific content type, HTML. 72

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 73 Disadvantage Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 73 Disadvantage of Physical URLs • Example: http: //www. airline. Inc. com/servlet/747 – Java servlets have well-known security problems. Announcing in the URL that servlets are being used at the server is an invitation to every hacker to try to exploit the servlet vulnerabilities. – Today airline. Inc. com implements the resource that is being identified by the URL using Java servlets. Suppose that tomorrow the implementation is changed. Although the above URL could still be used, it would no longer be appropriate. • Example: http: //www. camera. com/cannon. html – This URL is referencing an HTML document. Implicitly the URL is assuming the clients will always be browser-based (eyeball-based). Given the fact that the variety of clients on the Web is becoming increasingly diverse, the assumption is very limiting. 73

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 74 Logical Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 74 Logical URLs • A logical URL provides an identifier for a resource. It does not use implementation references, nor does it indicate a content (MIME) type. – Example: http: //www. airline. Inc. com/747 – Example: http: //www. camera. com/cannon 74

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 75 Advantage Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 75 Advantage of Logical URLs http: //w ww. ai rpla ce-co. com/7 47 Inc. com/747 www. airline http: // robot /747 c. com n line. I w. air w p: //w htt • Many different clients can access the resource using the same URL. MP 3 Player • A logical URL is a loose coupler (audio) between the client and the resource. 75 • Content type is determined by the resource.

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 76 Content Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 76 Content Type • What you fetch is a resource. • What you receive is a representation in the form of a particular content type. The Scream. jpg Scream. png Scream. bmp 76 Edward Munch's The Scream (1893) National Gallery, Oslo

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 77 Web Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 77 Web Services are Nothing Special • There is no fundamental difference between a browser interacting with a resource, and a web service interacting with a resource. The only difference is the format of the response document - HTML is returned to the browser, XML is returned to the web service. • It's all about the content, not the content type! 77

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 78 FAQ Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 78 FAQ • "If a URL doesn't reference a particular content type (e. g. , 747. html) then how will the resource being referenced know what type of document to return? " • Recall HTTP. When you issue a GET, an HTTP header is created (e. g. , the browser automatically constructs it for you when you submit a URL). The HTTP header contains many header fields, one of them is used to indicate what type of document the client desires from the resource: – "The Accept header, which is a request header, lets a client explicitly indicate what types of content it can accept in the message body of the server's response. " (HTTP specification) GET /747 HTTP/1. 1 Host: www. airline. Inc. com Accept: text/html 747 78

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. "Why Does It Matter whether I use Logical or Physical URLs? " • The Web is comprised of many types of clients. • A service that can have exchanges with only one type of client is destined for extinction. • Logical URLs are a way of announcing to the Web ecosystem, "I have created a resource and I am not limiting the type of client that can use my resource. " • Thus, logical URLs pave the way to unanticipated uses because a service can evolve 79 with its environment. 79

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 80 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 80 Summary • Physical URLs denote specific implementations. • Logical URLs name resources. • Logical URLs are decoupled from implementations. • Content types are specific implementations for resources. • Logical URLs open the door to unanticipated use. 80

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 81 Links Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 81 Links and the Structure of Knowledge 81

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 82 Connections Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 82 Connections • Burke's work argued for the connection of seemingly unrelated events. • He exposed the role of serendipity and inevitability in invention. • His novel interpretations led to the insight that connections are as important as what they connect. • He realized that understanding required understanding connections. • Presenting information on the Web requires more than feeding facts. It's about connecting facts that enable clients to weave a picture. 82

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 83 What Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 83 What are their Connections? • What is the connection between: – Thomas Kuhn and cash registers? – Dentistry and George Washington? We visited Wikipedia and found their connections. . . 83

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 84 Thomas Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 84 Thomas Kuhn and cash registers Thomas Kuhn The Structure of Scientific Revolutions Harvard University Charles William Elliot Panic of 1857 Embezzlement cash registers 84

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 85 Dentistry Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 85 Dentistry and George Washington Dentistry United States Thirteen Colonies American Revolutionary War George Washington 85

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 86 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 86 The Old Way of Structuring Knowledge • For millennia mankind has attempted to structure knowledge into nice, neat categories. • Mankind has attempted to build a single, definitive set of categories into which everything fits. • Some notable examples: – Dewey Decimal System – Periodic Table of the Chemical Elements – Scientific Classification 86

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 87 Problem Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 87 Problem with the Old Way of Structuring Knowledge • People don't always think in linear, taxonomic fashions • People find things by searching around in the area of interest • New information violates the old structure – New disciplines arise that don't fit into a slot in the Dewey Decimal Systems – Synthetic elements challenge the structure of the Periodic Table – Protista (single-celled organisms) don’t seem to be exactly Animal, Vegetable, or Mineral 87

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 88 Messy Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 88 Messy Structure of Knowledge • A taxonomy would put George Washington under – President of the United States – Rich men in colonial America – Founding Fathers • But in Wikipedia you might happen upon the entry for George Washington while researching 18 th century dental practices! • The world isn't organized into nice neat Dewey Decimal slots. • The structure of knowledge is messy. 88

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 89 Connections Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 89 Connections as Knowledge • Connections do more than relate what we know. • Knowledge of the relations is itself information. – Seeing how the facts are related to one another enables us to understand things • Understanding requires you to view information within a context of connections to other information • For example, Protestantism arose because: – The Roman Catholic church needed money for the Basilica, so it started selling indulgences (buy your way out of sin) – Gutenberg's business depended on quickly creating indulgences – Martin Luther became disgusted with the indulgences, and consequently separated from the Church 89

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 90 Links: Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 90 Links: Key to Representing Information • The hard part in representing information is in identifying meaningful links. • What is a meaningful link? – Representing all the elements according to the number of electrons in their electron shell is the organizing principle of the periodic table. It is a meaningful organization, but not the meaningful organization. – The challenge is to think about the way links connect things. • A meaningful link allows you to recast the structure of knowledge. • The Web is a technology that allows us to 90 represent knowledge as flexibly as the world does.

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Structuring Knowledge Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Structuring Knowledge for the Web 91 Suppose that you own a store and in your store you have, among other things, digital cameras. You may classify the digital cameras under photographic equipment. If this were a web site you wouldn't put it in just one category. You would put it in as many categories as possible. It's to your advantage to have it show up every place someone might be looking for digital cameras. In the real world you want a neat, clean, clear, and unambiguous classification scheme. Dewey Decimal is very neat and simple – it’s a simple branching structure. Whereas in the Web and other digital environments you want as much mess as possible, e. g. , you want the camera linked all over the place, the more links the more value. Messiness is a virtue on the Web! Excerpt from a talk titled Digital Future by David Wienberger 91

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 92 Each Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 92 Each User has his own Vantage Point THE WEB 92

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 93 Many Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 93 Many Vantage Points for Messy Knowledge • Many vantage points mean: – I can organize information around any starting point. • A starting point is any resource that's exposed on the Web. I can start traversing links from that starting point. • In order to satisfy unanticipated users, you have to be able to organize information around any starting point. That's what it is to satisfy different vantage points. • I have a certain view of the world. I want information organized by my world view. You have a different view of the world. You want information organized by your world view. The Web supports both! 93

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 94 No Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 94 No Single Vantage Point • We are compelled to believe that knowledge has a single, natural, and inherent structure. • So we constantly want to put knowledge into a structure. • The fact is that knowledge is unstructured. • It is because knowledge is unstructured that we can cast it into many different structures. • A vantage point captures the fact that we can recast the structure of knowledge. 94

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 95 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 95 Summary • Connections are as important as facts. • There is not just one way to organize information. • The Web captures/mirrors/allows you to do the same thing as the messiness of knowledge. • Messiness is a virtue of the Web. • The Web is a much better way of representing knowledge than the Dewey Decimal system, or the Periodic table, or any a priori classification system. • A vantage point converts unorganized information into structured knowledge. • Links are what makes possible unanticipated use because the user can organize the information from his vantage point. 95

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 96 Guidance Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 96 Guidance Do's and Don'ts 96

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 97 Guidance, Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 97 Guidance, Do's and Don'ts ---Net-Centric XML 97

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 98 No Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 98 No man island. . . No man island, entire of itself; every man is a piece of the continent, a part of the main. If a clod be washed away by the sea, Europe is the less, as well as if a promontory were, as well as if a manor of thy friend's of thine own were. Any man's death diminishes me because I am involved in mankind; and therefore never send to know for whom the bell tolls; for it tolls for thee. -- John Donne The point is: there's no such thing as a disconnected thing. Everything must interest me! 98

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 99 Browsing Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 99 Browsing Linked Information http: //www. airport. Inc. com/airports/ bos The Web paradigm is about linking information to other information. 1 2 HTML BOS-ALT BOS-LAX BA 99 99

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 100 Why Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 100 Why Links are Valuable • More links make it easier to find things. • The value of a network is proportional to the square of the number of links. Metcalf's Law Value ~ N 2 # Links 1 10 100 Value 1 10000 100

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 101 Linked Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 101 Linked Web Documents • You are very accustomed to creating and using HTML documents that contain links. • Likewise, XML documents should contain links. XML XML XML 101

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 102 Linking Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 102 Linking in XML • XLink is the technology for linking XML documents. • This technology defines many attributes, but the attribute that is important for this discussion is "href" (hyperlink reference). • Use xlink: href to link an XML document to a resource. Boston Airport DATA Use the XLink href attribute to link to other information. 102

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 103 Example Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 103 Example - Boston Airport Data • Problem: organize information about the Boston airport. The Boston airport (BOS) has these airplanes (tail number): FX 12 and BA 99. FX 12 flies this route: BOS-LAX. BA 99 flies this route: BOS-ALT. • You might be tempted to create a monolithic XML document that contains all the information: Boston Airport Data Plane FX 12 Data Boston to LAX Route Data Plane BA 99 Data Boston to ALT Route Data 103

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 104 Your Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 104 Your Document is an Island! • The Web is all about creating a network of information, but you have designed a document not linked to the rest of the Web. • XML islands are of low value. • Create high value XML documents by linking to other resources! 104

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 105 Airport Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 105 Airport Data using a Web Design BOS. xml BOS-LAX. xml BOS-ALT. xml FX 12. xml In the Web these resources can be discovered from the outside, and these resources can lead to other "outside" resource. Everything is connected! 105

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 106 Applying Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 106 Applying the Paradigm to Machines http: // www. airport. Inc. com/airports/bos 2 • An XML representation 1 should link to other information, just like an HTML representation links to other information. XML BOS-LAX BOS-ALT FX 12 106

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 107 Link, Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 107 Link, don't Embed Boston Airport DATA 107

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 108 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 108 Summary • The more links you have to other information, the more valuable is your information. • XLink is the technology for linking XML documents to other resources. • Insert links into your XML documents! 108

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 109 Guidance, Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 109 Guidance, Do's and Don'ts ---"Getting Information" versus "Doing Things" 109

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 110 Common Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 110 Common Fallacy Web services are different than ordinary web usage. I agree that in the ordinary web you exchange information (documents). But web services are not about "getting information" (documents), they’re about "doing things". 110

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 111 Activity Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 111 Activity as a Result of Information Exchange • Doing things is a consequence of information exchange. – Example: (At my bank) "Here's my deposit. " The response is "Here's your receipt. " The consequence is my bank account is updated. • The actions that occurred by the bank during this information exchange is totally opaque to me. • Thus we can model "doing things" as information exchange. 111

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 112 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 112 The Web Paradigm is one of Exchanging Information Server Information (document) goes into a web server. A server responds with information (document). How the server generated the response document is opaque and irrelevant to the client. All the client needs to know is that it sends the server some information, and the server responds with some information. 112

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 113 How Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 113 How does this Help me? • Viewing web services as only one of "doing things" is narrow vision. • The cost for narrow vision is lost opportunity. • The Web is an ecosystem, comprised of many different clients. These clients operate by exchanging documents of different content types. • For your web service to operate with the rest of the Web, you must adopt the Web paradigm of exchanging information. • The Web is a large network for the interchange of information. It is a mechanism, a conduit, for information exchange. That’s why we have this paradigm shift. It’s not about invoking subroutines; it’s not process; it’s not procedure oriented. It’s about exchanging information. 113

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 114 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 114 Summary • A fundamental paradigm of the Web is information exchange. • "Doing things" can be modeled as information exchange. • When we create web services we need to exploit the Web model of information exchange. • A web service is not an isolated thing, it is part of a larger ecosystem. • An interaction with a web service must be one of exchanging information (documents). 114

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 115 Guidance, Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 115 Guidance, Do's and Don'ts ---Characterizing Good Web Services 115

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 116 Understanding Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 116 Understanding within the Context of a Paradigm • In the following slides we will take a problem that you are used to and recast it under the new (Web) paradigm. • It will demonstrate how to understand problems from the perspective of the new paradigm • To give you a feel for how dramatically perspective and behavior changes with a new paradigm, consider how the outbreak of disease was reacted to before and after the germ theory of disease: • Before: "You are possessed by demons. You must be exorcised" • After: "The sewage strewn on the streets are natural breeding ground for disease. Wash your hands, clean up the streets. " 116

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 117 Case Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 117 Case Study: Currency Converter Web Service • Create a web service that is able to convert a value in one currency into its equivalent value in another currency, using the currency rates for a particular date. • Example: On Jan. 14, 2006 one hundred US dollars was equivalent at close of trading to 3, 956. 92 Thai Baht. • Let's suppose that the hostname for your 117 service is: www. trader. Inc. com

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 118 Step Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 118 Step 1: Identify the Resource(s) • The resource is a "currency conversion form". http: //www. trader. Inc. com/currency-conversion-form Currency Conversion Form Note that the URL is a logical URL 118

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 119 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 119 The client GETs the form by issuing the URL 1 USAGE Client http: //www. trader. Inc. com/currency-conversion-form Form (in a representation suitable for the client) Currency Conversion Form 2 The client fills in the form, and then POSTs it to the same URL (thereby "updating" the form) http: //www. trader. Inc. com/currency-conversion-form 3 Completed Form Currency Conversion Form Client Form with the results 4 119

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 120 Halt! Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 120 Halt! Wrong Direction • We are heading in the wrong direction. • The name "Currency Converter" should have immediately alerted us to a problem. It's a process. – The currency converter "form" is a facade for the intent to do something. It is the old programming paradigm insidiously sneaking onto the Web. • The Web paradigm is not about invoking processes, it's about exchanging information. • A Currency Converter is not an appropriate web service. 120

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 121 Analogous Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 121 Analogous to a Document Converter Web Service Would it be reasonable to create a web service that converts document formats? "Please convert from HTML to MP 3" US News. html Document Format Converter Service 121

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 122 News Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 122 News Service "Please give me the US news" US News. html 2 1 "Please convert from HTML to MP 3" US News. html 3 Document Format Converter Service US News. mp 3 4 Halt! Wrong Direction 122

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 123 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 123 The Right Approach 1 "MP 3 file please" News Service US News. mp 3 2 123

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 124 Analogous Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 124 Analogous to an Image Conversion Web Service Would it be reasonable to create an image conversion web service? "Please convert my image from. bmp to. jpg" Map of Boston. bmp Image Format Converter 124

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 125 Map Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 125 Map Service "Please give me a map of Boston" Map of Boston. bmp 2 1 "Please convert my image from. bmp to. jpg" Map of Boston. bmp 3 Image Format Converter Map of Boston. jpg 4 Halt! Wrong Direction 125

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 126 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 126 The Right Approach 1 "JPG format please" Map Service Map of Boston. jpg 2 126

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 127 FAQ Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 127 FAQ • • "But suppose that I just obtained a. bmp file of an important image and I want to make it available to clients through my web service. There are no other formats (. jpg, . gif) currently available of the image. Isn't this an example of where it would be useful to have a web service that does image format conversion? " Answer: No! Clearly conversion needs to be done, but that doesn't mean that a separate web service should be created to do image conversion. There are many open-source packages available for doing image conversion. The web service should (internally) use one of these packages. Client "Please give me the image in. jpg format" image converter (open source) Web Service 127

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 128 Fundamental Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 128 Fundamental Fallacy • Fallacy: everything that can be done, should be done on the Web. • The fact is that many things should not be done on the Web. Things that fit the Web paradigm can reasonably be done on the Web. Things that don't fit should either – be recast into the Web paradigm, or – not be done on the Web (use an application instead) 128

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 129 Analogous Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 129 Analogous to a Sorting Web Service Would it be reasonable to create a sorter web service? "Please sort based on last name" staff list (unsorted) Sorter Service 129

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 130 Staff Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 130 Staff "Please give me the list of staff" staff list (unsorted) 2 1 "Please sort based on last name" staff list (unsorted) 3 Sorter Service staff list (sorted) 4 Halt! Wrong Direction 130

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 131 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 131 The Right Approach 1 "Sorted by last name please" Staff staff list (sorted) 2 131

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 132 Currency Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 132 Currency Converter Web Service? Is it reasonable to create a currency converter web service? "Please convert to Thai Baht" Bank statement (USD) Currency Converter John Doe in Thailand 132

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 133 ATM Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 133 ATM "Please give me my bank statement" Bank statement (USD) 1 2 "Please convert to Thai Baht" Bank statement (USD) John Doe in Thailand 3 Currency Converter Bank statement (THB) 4 Halt! Wrong Direction 133

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 134 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 134 The Right Approach 1 "Bank statement please" ATM John Doe in Thailand Bank statement (THB) 2 134

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 135 From Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 135 From Process Paradigm to Information Paradigm • Notice how we have recast the problems, from "doing something" to "exchanging information" (in an appropriate format): – Instead of a document format converter, the news service serves up news in different formats. – Instead of an image format converter, the map service serves up maps in different formats. – Instead of a sorter service, the staffing service serves up the staff list in various sorted orders. – Instead of a currency converter service, the bank account service serves up the balance in the proper currency. 135

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 136 Have Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 136 Have it your way • Would you order your hamburger, be stuck with accepting it with all the condiments, and then take it to another counter where you ask them "Would you please take off the pickles, remove the ketchup, and add more mustard? " • No! You would order it the way you want to eat it. 136

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 137 Meeting Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 137 Meeting Customer Expectations • [1920 s] Henry Ford said, "You can buy it (a Model T) in any color, as long as it's black. " • [1923] Alfred Sloan understood the problem (that Ford was not responding to customer needs) and allowed customers to order cars in color. • [1927] Chevrolet nearly put Ford out of business. 137

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 138 Meeting Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 138 Meeting Customer Expectations is all about Providing Multiple Content Types. html, . mp 3, . . . News USD, THB, . . . ATM Map . bmp, . jpg, . gif, . . . Staff sorted by last name, sorted by employee number, . . . 138

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 139 Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 139 "But there is no USD, THB content type" GET /accounts/John_Doe/balance HTTP/1. 1 Host: www. chase. com Accept: THB ATM John Doe's money Likewise, there is no "sorted by last name" content type: GET /staff HTTP/1. 1 Host: www. company. org Accept: Sorted by last name Staff 139

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 140 Solution Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 140 Solution is Analogous to the Airline Reservation Priority Example Approach 1: Put an indication of the desired currency in the payload: GET /accounts/John_Doe/balance HTTP/1. 1 Host: http: //www. chase. com ATM Desired Currency: THB John Doe's money Approach 2: Put the desired currency into the URL: GET /accounts/John_Doe/balance/THB HTTP/1. 1 Host: http: //www. chase. com ATM Best Practice: put into the URL John Doe's money 140

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 141 [Zen] Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 141 [Zen] mu: unask the question • [Student] "How do I create a currency conversion service? " • [Master] You must unask the question. Reframe the problem and explore it in terms of information exchange. • Recasting the problem into an information problem leads to a different solution. • The key to reframing the currency problem is seeing that the resource is value and that it is represented in different currencies. Value Client "The cost of … is … Baht" 141

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 142 The Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 142 The Right Currency in the Right Place • An exciting aspect of the Web is that clients can see values expressed in their native "language" when in their native "environment". – This is true whether you're talking about getting images in the right format, getting documents in the right format, getting news the way you want to hear it, or value in the right currency. • A web service should (internally) convert to the currency appropriate for the client. – When you are at home (US) and booking the Bankok Hilton on your credit card it (the Hilton) should quote room rates in USD. – When you are at home and reserving a car from Hertz at Charles de Gaulle airport it should quote car rates in USD. – When you're withdrawing cash to buy lunch while in Bankok your bank should show your balance in Thai Baht. 142

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 143 Web Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 143 Web Service Implementation for John Doe's Bank Account 1 http: //www. chase. com/account/john-doe/balance/USD John Doe at ATM in USA John Doe's money 100. 00 USD 2 John Doe GETs a statement of his value in USD. 143

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Currency Received Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Currency Received is that Appropriate for the Country 144 (currency conversion is invisible) 1 http: //www. chase. com/account/john-doe/balance/THB John Doe at ATM in Thailand John Doe's money 3, 956. 92 THB 2 John Doe GETs a statement of his value in Thai Baht. 144

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 145 What Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 145 What Resource is Required to Convert? "Give me the ratio that Dollars and Baht changed hands at the last trade of the day. " John Doe's money http: //www. trader. Inc. com/foreign-exchange-trading/USD-THB/COB conversion rate of the last trade of the previous day The client uses the conversion rate to calculate how many Thai Baht correspond to 100 USD. Foreign Currency Trading This resource is a record from the marketplace of all the foreign currency exchanges 145

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 146 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 146 Summary • The Web paradigm requires moving from an emphasis on processing to an emphasis on information. • Rather than a client accepting information in a fixed format, and then finding a way to convert it to the desired format, the service delivers it the way the client wants. • The conversion of information is not a separate process, it's an integral part of responding to client requests. 146

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 147 Guidance, Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 147 Guidance, Do's and Don'ts ---Characterizing Good Web Documents 147

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 148 Create Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 148 Create XML that is Independent of Implementation • It's not the case that "any old XML will suffice. " • The following slides discusses the importance of creating XML that is free of implementation-specific information. 148

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Example of Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Example of Poor Web Document Design 149 Bank. Inc Server John Doe 100. 00 USD client This Web document contains information that is specific to the Bank. Inc implementation, i. e. , subroutine name, parameter name. subroutine Create-Account (String name, Decimal amount, String currency) { -- code to create account -} 149

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. <Create-Account> <name>John Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. John Doe 100. 00 USD Bank. Inc Server 150 subroutine Create-Account (String name, Decimal amount, String currency) { -- code to create account -} Travel. Forum Server client The XML document is a point-to-point solution. It has implementation-specific information. It cannot be used by other web services. subroutine Account. Generator (Decimal a, String n String c) { -- code to create account -} 150

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 151 Why Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 151 Why is the Web Document Bad? • It is tied to a specific implementation. – Good Web documents can be used in lots of different ways. • There actually two transactions confused as one. – Creating an account – Making a (initial) deposit • It replicates information rather than linking to it. – John Doe's identity information should be linked to, thus making it usable in multiple situations. • It fails to exploit the primary benefits of the Web. 151 – Reuse, atomic operations, links

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 152 Good Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 152 Good Web Document Design 1. This document can be used for lots of financial transactions (e. g. , I could send the same document to Merrill Lynch to open a brokerage account, or to a mutual fund to open an IRA account). 2. Using links, rather than embedding information, allows changes to replicate instantly (e. g. , when I change my address, the bank, the brokerage firm, the mutual fund all get updated instantly). 3. "Where's the money? " Answer: After the account is created then you can make a deposit. They are two separate transactions. 152

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 153 A Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 153 A Good Web Document is Reusable John Doe

Bank Merrill Lynch . . . IRA 153

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Characterizing Good Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. Characterizing Good Web Documents client 154 web service Free of implementation-specific information. Advantages: - Decoupled: There is nothing in the document that ties the client to a particular web service. The client and server are decoupled. This promotes Web scalability. - Independent Evolution: The client and server can evolve independently, e. g. , the server can change its implementation without impacting the client. - Scalable: Multiple web services can potentially process the same information. - Unanticipated Uses: The information can be used in ways never anticipated. - Increased Information Value: The greater the number of web services that can 154 use the information and the greater the number of different ways the information is used results in increased value of the information.

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 155 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 155 Summary • Good Web documents have lots of uses. Poor documents only one. • The information exchanged is the same. Only the format changes. • When designing a web service focus on the essential. – Information accepted by the service – Information returned by the service 155

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 156 Closing Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 156 Closing Remarks 156

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 157 What Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 157 What is a Web Service? A Web Service is a software implementation for a resource, identified by a URL, and reached using internet protocols. The software converts the resource to an appropriate content type. If there were no conversion required, then everything could be static; no software, no web service, would be required. The raison d'ètre we have the software is to 157 convert information.

Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 158 Summary Copyright © [2006]. Roger L. Costello, Timothy D. Kehoe. All Rights Reserved. 158 Summary • Understand web services as information providers within a network of information. • Link to other information within the network. • Exchange information with more than one type of client. • Think in terms of manipulating information, not in terms of dispensing services. 158