Database Management Systems Session 7 Instructor: Vinnie Costa vcosta@optonline.net CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 1
Term Paper � Due Next Saturday, Oct 8 � Should be about 3-4 pages (9 or 10 font) Homework � Read Chapter Six � Any Questions? MidTerm Exam � Any not get there’s? CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 2
An Innocent Idea…Whoops! William Bright, 27, displays his iPod with a subway map display outside a SoHo subway station in New York Thursday, Sept. 29, 2005. Tens of thousands of people have downloaded maps Bright created in early August. San Francisco and New York City officials were less enthusiastic. Bright received a "cease and desist" letter from a lawyer for the Metropolitan Transit Authority. http://www.ipodsubwaymaps.com CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 3
Internet Applications Chapter 7 CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 4
Lecture Overview � Internet Concepts � Web data formats � HTML, XML, DTDs � Introduction to three-tier architectures � The presentation layer � HTML forms, HTTP Get and POST, URL encoding, Javascript, Stylesheets, XSLT � The middle tier � CGI, application servers, Servlets, JavaServerPages, passing arguments, maintaining state (cookies) CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 5
Uniform Resource Identifiers � Uniform naming schema to identify resources on the Internet � A resource can be anything: � index.html � mysong.mp3 � picture.jpg � Example URIs: http://www.cs.wisc.edu/~dbbook/index.html mailto:webmaster@bookstore.com CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 6
Structure of URIs http://www.cs.wisc.edu/~dbbook/index.html � URI has three parts: � Naming schema (http) � Name of the host computer (www.cs.wisc.edu) � Name of the resource (~dbbook/index.html) � URLs are a subset of URIs CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 7
Hypertext Transfer Protocol What is a communication protocol? � � Set of standards that defines the structure of messages � Examples: TCP, IP, HTTP What happens if you click on � www.cs.wisc.edu/~dbbook/index.html ? � Client (web browser) sends HTTP request to server � Server receives request and replies � Client receives reply; makes new requests CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 8
HTTP (Contd.) Client to Server: Server replies: HTTP/1.1 200 OK GET ~/index.html HTTP/1.1 Date: Mon, 04 Mar 2002 User-agent: Mozilla/4.0 12:00:00 GMT Accept: text/html, image/gif, Server: Apache/1.3.0 (Linux) image/jpeg Last-Modified: Mon, 01 Mar 2002 09:23:24 GMT Content-Length: 1024 Content-Type: text/html <HTML> <HEAD></HEAD> <BODY> <h1>Barns and Nobble Internet Bookstore</h1> Our inventory: <h3>Science</h3> <b>The Character of Physical Law</b> ... CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 9
HTTP Protocol Structure HTTP Requests � Request line: GET ~/index.html HTTP/1.1 � GET : Http method field (possible values are GET and POST, more later) � ~/index.html : URI field � HTTP/1.1 : HTTP version field � Type of client: User-agent: Mozilla/4.0 � What types of files will the client accept: Accept: text/html, image/gif, image/jpeg CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 10
HTTP Protocol Structure (Contd.) HTTP Responses � Status line: HTTP/1.1 200 OK HTTP version: HTTP/1.1 � Status code: 200 � Server message: OK � � Common status code/server message combinations: • 200 OK : Request succeeded • 400 Bad Request : Request could not be fulfilled by the server • 404 Not Found : Requested object does not exist on the server • 505 HTTP Version not Supported � Date when the object was created: Last-Modified: Mon, 01 Mar 2002 09:23:24 GMT � Number of bytes being sent: Content-Length: 1024 � What type is the object being sent: Content-Type: text/html � Other information such as the server type, server time, etc. CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 11
A Simple Idea Marc Andreessen , born in Iowa, 1971, received his BA in � computer science from the University of Illinois, Urbana- Champaign, where research was being done at the university's National Center for Supercomputing Applications on early browsers such as ViolaWWW (created by Pei-Yuan Wei in 1993), based on Tim Berners- Lee's open standards for the World Wide Web . These earlier browsers had been created to work only on � expensive Unix workstations, so Andreessen and a full- time salaried co-worker Eric Bina worked on creating an improved and user-friendlier version with integrated graphics that would work on personal computers. The resulting code was the Mosaic web browser. After graduating, he teamed up with with Jim Clark , the � founder of Silicon Graphics , and formed the Mosaic Communications Corporation in Mountain View, California, with Andreessen appointed as a vice-president. The University of Illinois was unhappy with the use of the Mosaic name, so Mosaic Communications changed its name to Netscape Communications , and its flagship web browser was the Netscape Navigator . http://www.ibiblio.org/pioneers/andreesen.html � CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 12
A Previous Simple Idea � Vannevar Bush , born 1890, in Chelsea, Massachusetts, was never directly involved with the creation or development of the Internet. Yet many consider Bush to be the Godfather of our wired age often making reference to his 1945 essay, " As We May Think ." � In his article, Bush described a theoretical machine he called a " memex," which was to enhance human memory by allowing the user to store and Differential Analyzer - 1931 retrieve documents linked by associations (what he called associative trails ). This associative linking was very similar to what is known today as hypertext . � Vannevar Bush died on June 30, 1974, years before the Internet became widely popular or the World Wide Web even existed. With the growing popularity of the Internet many now look back through its history and see Bush as a visionary. � http://www.ibiblio.org/pioneers/bush.html CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 13
Some Remarks About HTTP � HTTP is stateless � No “sessions” � Every message is completely self-contained � No previous interaction is “ remembered ” by the protocol � Tradeoff between ease of implementation and ease of application development: Other functionality has to be built on top � Implications for applications: � Any state information (shopping carts, user login- information) need to be encoded in every HTTP request and response! � Popular methods on how to maintain state : • Cookies (later this lecture) • Dynamically generate unique URL’s at the server level (later this lecture) CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 14
Lecture Overview � Internet Concepts � Web data formats � HTML, XML, DTDs � Introduction to three-tier architectures � The presentation layer � HTML forms; HTTP Get and POST, URL encoding; Javascript; Stylesheets. XSLT � The middle tier � CGI, application servers, Servlets, JavaServerPages, passing arguments, maintaining state (cookies) CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 15
Web Data Formats � HTML � The presentation language for the Internet � XML � A self-describing, hierarchal data model � DTD � Standardizing schemas for Xml � XSLT (not covered in the book) CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 16
HTML: An Example <HTML> <h3>Fiction</h3> <HEAD></HEAD> <b>Waiting for the Mahatma</b> <BODY> <UL> <h1>Barns and Nobble Internet <LI>Author: R.K. Narayan</LI> Bookstore</h1> <LI>Published 1981</LI> Our inventory: </UL> <b>The English Teacher</b> <h3>Science</h3> <UL> <b>The Character of Physical Law</b> <LI>Author: R.K. Narayan</LI> <UL> <LI>Published 1980</LI> <LI>Author: Richard <LI>Paperback</LI> Feynman</LI> </UL> <LI>Published 1980</LI> <LI>Hardcover</LI> </BODY> </UL> </HTML> CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 17
HTML: A Short Introduction � HTML is a markup language � Commands are tags: � Start tag and end tag � Examples: • <HTML> … </HTML> • <UL> … </UL> � Many editors automatically generate HTML directly from your document (e.g., Microsoft Word has an “Save as html” facility) � Nvu is perfect for this CSC056-Z1 – Database Management Systems – Vinnie Costa – Hofstra University 18
Recommend
More recommend