Professional Documents
Culture Documents
Lecture 1
Cs.aiub.edu/~Jitu
INTRODUCTION
Lecture-1
Cs.aiub.edu/~jitu
Client/Server model
Distributed application structure that partitions tasks or workloads between the providers of a resource or service, called servers, and service requesters, called clients. Often clients and servers communicate over a computer network on separate hardware, but both client and server may reside in the same system. A server machine is a host that is running one or more server programs which share their resources with clients.
Lecture-1
Cs.aiub.edu/~jitu
Lecture-1
Cs.aiub.edu/~jitu
Client/Server model
Lecture-1
Cs.aiub.edu/~jitu
Lecture-1
Cs.aiub.edu/~jitu
Lecture-1
Cs.aiub.edu/~jitu
Client/server Advantages
Easy to maintain and upgrade only one machine. Data security implementation is easy. Servers can better control access and resources, to guarantee that only those clients with the appropriate permissions may access and change data. Since data storage is centralized, updates to that data are far easier to administer in comparison to a P2P paradigm. It functions with multiple different clients of different capabilities.
Lecture-1
Cs.aiub.edu/~jitu
Client/server Disadvantages
As the number of simultaneous client requests to a given server increases, the server can become overloaded. The clientserver paradigm lacks the robustness of a good P2P network.
In P2P networks, resources are usually distributed among many nodes. Even if one or more nodes depart and abandon a downloading file, for example, the remaining nodes should still have the data needed to complete the download.
Lecture-1
Cs.aiub.edu/~jitu
10
Question ???
What is the difference between internet and Web?
Lecture-1
Cs.aiub.edu/~jitu
11
Internet
Global system of interconnected computer networks .
Use the standard Internet Protocol Suite (TCP/IP). Serve billions of users worldwide. Network of networks that consists of millions of private, public, academic, business, and government networks. Carries a vast range of information resources and services, such as the inter-linked hypertext documents of the World Wide Web and the infrastructure to support electronic mail.
Lecture-1
Cs.aiub.edu/~jitu
12
Lecture-1
Cs.aiub.edu/~jitu
13
Internet vs WWW
Internet Global system of interconnected computer networks. In short, the Web is an application running on the Internet. WWW One of the services that runs on the Internet. It is a collection of interconnected documents and other resources, linked by hyperlinks and URLs. An application running on the Internet.
Lecture-1
Cs.aiub.edu/~jitu
14
WWW function
Viewing a web page on the World Wide Web normally begins
typing the URL of the page into a web browser, following a hyperlink to that page or resource.
The web browser then initiates a series of communication messages, behind the scenes, in order to fetch and display it. First, the server-name portion of the URL is resolved into an IP address using the global, distributed Internet database known as the Domain Name System (DNS).
Lecture-1
Cs.aiub.edu/~jitu
15
While receiving these files from the web server, browsers may progressively render the page onto the screen as specified by its HTML, Cascading Style Sheets (CSS), or other page composition languages.
Any images and other resources are incorporated to produce the on-screen web page that the user sees. Most web pages contain hyperlinks to other related pages and perhaps to downloadable files, source documents, definitions and other web resources.
Lecture-1
Cs.aiub.edu/~jitu
16
WWW standards
Many of the documents are the work of the World Wide Web Consortium (W3C). Some of the documents are produced by the Internet Engineering Task Force (IETF) and other organizations. markup languages, especially HTML and XHTML, from the W3C
define the documents structure and interpretation of hypertext
stylesheets, especially CSS, from the W3C. ECMAScript (usually in the form of JavaScript), from Ecma International.
Lecture-1
Cs.aiub.edu/~jitu
17
Lecture-1
Cs.aiub.edu/~jitu
18
Lecture-1
Cs.aiub.edu/~jitu
19
20
21
Lecture-1
Cs.aiub.edu/~jitu
22
Lecture-1
Cs.aiub.edu/~jitu
23
Browsers
A web browser or Internet browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier (URI) and may be a web page, image, video, or other piece of content. e.g.
Internet Explorer Netscape Mozilla Firefox Opera Google Chrome Apple Safari
Lecture-1
Cs.aiub.edu/~jitu
24
XML
Lecture-1
Cs.aiub.edu/~jitu
25
What is XML?
XML stands for EXtensible Markup Language XML was designed to carry data, not to display data XML tags are not predefined. You must define your own tags XML is designed to be self-descriptive XML is a W3C Recommendation
Lecture-1
Cs.aiub.edu/~jitu
26
Lecture-1
Cs.aiub.edu/~jitu
27
Lecture-1
Cs.aiub.edu/~jitu
28
XML is Everywhere
XML is now as important for the Web as HTML was to the foundation of the Web. XML is the most common tool for data transmissions between all sorts of applications.
Lecture-1
Cs.aiub.edu/~jitu
29
Lecture-1
Cs.aiub.edu/~jitu
30
XML Example
Lecture-1
Cs.aiub.edu/~jitu
31
Lecture-1
Cs.aiub.edu/~jitu
32
XML Attributes
Attributes often provide information that is not a part of the data. In the example below, the file type is irrelevant to the data, but can be important to the software that wants to manipulate the element:
<file type="gif">computer.gif</file>
Lecture-1
Cs.aiub.edu/~jitu
33
Lecture-1
Cs.aiub.edu/~jitu
34
XML Syntax
All XML Elements Must Have a Closing Tag XML Tags are Case Sensitive XML Elements Must be Properly Nested XML Documents Must Have a Root Element XML Attribute Values Must be Quoted
Lecture-1
Cs.aiub.edu/~jitu
35
HTML
Lecture-1
Cs.aiub.edu/~jitu
36
What is HTML?
HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it is a markup language A markup language is a set of markup tags HTML uses markup tags to describe web pages
Lecture-1
Cs.aiub.edu/~jitu
37
HTML Tags
HTML markup tags are usually called HTML tags
HTML tags are keywords surrounded by angle brackets like <html> HTML tags normally come in pairs like <b> and </b> The first tag in a pair is the start tag, the second tag is the end tag Start and end tags are also called opening tags and closing tags
Lecture-1
Cs.aiub.edu/~jitu
38
Lecture-1
Cs.aiub.edu/~jitu
39
XML vs HTML
XML is not a replacement for HTML. XML and HTML were designed with different goals:
XML was designed to transport and store data, with focus on what data is HTML was designed to display data, with focus on how data looks
Lecture-1
Cs.aiub.edu/~jitu
40
HTML 5.0
Lecture-1
Cs.aiub.edu/~jitu
41
What is HTML5?
HTML5 will be the new standard for HTML, XHTML, and the HTML DOM. The previous version of HTML came in 1999. The web has changed a lot since then. HTML5 is still a work in progress. However, most modern browsers have some HTML5 support.
Lecture-1
Cs.aiub.edu/~jitu
42
Lecture-1
Cs.aiub.edu/~jitu
43
New Features
Some of the most interesting new features in HTML5:
The canvas element for drawing The video and audio elements for media playback Better support for local offline storage New content specific elements, like article, footer, header, section etc. New form controls, like calendar, date, time, email, url, search
Browser Support
The latest versions of Safari, Chrome, Firefox, and Opera support some HTML5 features. Internet Explorer 9 will support some HTML5 features.
Lecture-1
Cs.aiub.edu/~jitu
44
XHTML
Lecture-1
Cs.aiub.edu/~jitu
45
What Is XHTML?
XHTML stands for EXtensible HyperText Markup Language XHTML is almost identical to HTML 4.01 XHTML is a stricter and cleaner version of HTML XHTML is HTML defined as an XML application XHTML is a W3C Recommendation
Lecture-1
Cs.aiub.edu/~jitu
46
XHTML - Why?
XHTML is a combination of HTML and XML (EXtensible Markup Language). XHTML consists of all the elements in HTML 4.01, combined with the strict syntax of XML. The following HTML code will work just fine if you view it in a browser (even if it does NOT follow the HTML rules):
<html> <head> <title>This is bad HTML</title> <body> <h1>Bad HTML <p>This is a paragraph </body>
Lecture-1
Cs.aiub.edu/~jitu
47
48
HTML vs XHTML
XHTML elements must be properly nested XHTML elements must always be closed XHTML elements must be in lowercase XHTML documents must have one root element
Lecture-1
Cs.aiub.edu/~jitu
49
Lecture-1
Cs.aiub.edu/~jitu
50
DOM
Lecture-1
Cs.aiub.edu/~jitu
51
The DOM defines the objects and properties of all document elements, and the methods (interface) to access them.
Lecture-1
Cs.aiub.edu/~jitu
52
CSS
Lecture-1
Cs.aiub.edu/~jitu
53
What is CSS?
CSS stands for Cascading Style Sheets A style language that defines layout of HTML documents.
For example, CSS covers fonts, colors, margins, lines, height, width, background images, advanced positions and many other things. Just wait and see!
HTML can be (mis-)used to add layout to websites. But CSS offers more options and is more accurate and sophisticated. CSS is supported by all browsers today.
Lecture-1
Cs.aiub.edu/~jitu
54
Benefits of CSS
control layout of many documents from one single style sheet; more precise control of layout; apply different layout to different media-types (screen, print, etc.); numerous advanced and sophisticated techniques.
Lecture-1
Cs.aiub.edu/~jitu
55
Applying CSS
Three ways you can apply CSS to an HTML document Method 1: In-line (the attribute style)
using the HTML attribute style
Lecture-1
Cs.aiub.edu/~jitu
56
Priority
We also have another two types of styles at the client end.
One is user defined style Other is browser default style.
Priority
User defined style Embedded or inline style sheet Internal style sheet External style sheet Browser default style
Lecture-1
Cs.aiub.edu/~jitu
57
JAVASCRIPT
Lecture-1
Cs.aiub.edu/~jitu
58
What is JavaScript?
JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight programming language JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language (means that scripts execute without preliminary compilation) The Real Name is ECMAScript
Lecture-1
Cs.aiub.edu/~jitu
59
VBSCRIPT
Lecture-1
Cs.aiub.edu/~jitu
60
What is VBScript?
VBScript is a scripting language A scripting language is a lightweight programming language VBScript is a light version of Microsoft's programming language Visual Basic VBScript is only supported by Microsoft's browsers (Internet Explorer)
Lecture-1
Cs.aiub.edu/~jitu
61
DHTML
Lecture-1
Cs.aiub.edu/~jitu
62
DHTML
DHTML stands for Dynamic HTML. DHTML is NOT a language or a web standard. To most people DHTML means the combination of HTML, JavaScript, DOM and CSS. According to the World Wide Web Consortium (W3C)
"Dynamic HTML is a term used by some vendors to describe the combination of HTML, style sheets and scripts that allows documents to be animated."
Lecture-1
Cs.aiub.edu/~jitu
63
DTD
Lecture-1
Cs.aiub.edu/~jitu
64
What is DTD?
A Document Type Definition (DTD) defines the legal building blocks of an XML document. It defines the document structure with a list of legal elements and attributes. A DTD can be declared inline inside an XML document, or as an external reference.
Lecture-1
Cs.aiub.edu/~jitu
65
XSD
Lecture-1
Cs.aiub.edu/~jitu
66
What is an XSD?
XML Schema is an XML-based alternative to DTD. An XML schema describes the structure of an XML document. The XML Schema language is also referred to as XML Schema Definition (XSD). XML Schemas are the Successors of DTDs Also written in a XML file(not like DTD)
Lecture-1
Cs.aiub.edu/~jitu
67
XSLT
Lecture-1
Cs.aiub.edu/~jitu
68
What is XSLT
XSL stands for EXtensible Stylesheet Language, and is a style sheet language for XML documents. XSLT stands for XSL Transformations.
Lecture-1
Cs.aiub.edu/~jitu
69
XSL Languages
It started with XSL and ended up with XSLT, XPath, and XSL-FO. It Started with XSL
XSL stands for EXtensible Stylesheet Language. The World Wide Web Consortium (W3C) started to develop XSL because there was a need for an XML-based Stylesheet Language.
70
Lecture-1
Cs.aiub.edu/~jitu
71
XPATH
Lecture-1
Cs.aiub.edu/~jitu
72
What is XPath?
XPath is a syntax for defining parts of an XML document XPath uses path expressions to navigate in XML documents XPath contains a library of standard functions XPath is a major element in XSLT XPath is a W3C recommendation
Lecture-1
Cs.aiub.edu/~jitu
73
XQUERY
Lecture-1
Cs.aiub.edu/~jitu
74
What is XQuery?
XQuery is the language for querying XML data XQuery for XML is like SQL for databases XQuery is built on XPath expressions XQuery is supported by all major databases XQuery is a W3C Recommendation
Lecture-1
Cs.aiub.edu/~jitu
75
Lecture-1
Cs.aiub.edu/~jitu
76
What is XLink?
XLink defines a standard way of creating hyperlinks in XML documents. XLink is short for XML Linking Language XLink is used to create hyperlinks in XML documents Any element in an XML document can behave as a link XLink supports simple links (like HTML) and extended links (for linking multiple resources together) With XLink, the links can be defined outside the linked files XLink is a W3C Recommendation
Lecture-1
Cs.aiub.edu/~jitu
77
What is XPointer?
XPointer allows the hyperlinks to point to more specific parts (fragments) in the XML document. XPointer is short for XML Pointer Language XPointer allows the links to point to specific parts of an XML document XPointer uses XPath expressions to navigate in the XML document XPointer is a W3C Recommendation
Lecture-1
Cs.aiub.edu/~jitu
78
XSL-FO
Lecture-1
Cs.aiub.edu/~jitu
79
What is XSL-FO?
XSL-FO stands for Extensible Stylesheet Language Formatting Objects. XSL-FO is a language for formatting XML data for output to screen, paper or other media. XSL-FO is based on XML XSL-FO is a W3C Recommendation XSL-FO is now formally named XSL
Lecture-1
Cs.aiub.edu/~jitu
80
XFORMS
Lecture-1
Cs.aiub.edu/~jitu
81
What Is XForms?
XForms is the next generation of HTML forms XForms is richer and more flexible than HTML forms XForms will be the forms standard in XHTML 2.0 XForms is platform and device independent XForms separates data and logic from presentation XForms uses XML to define form data XForms stores and transports data in XML documents XForms contains features like calculations and validations of forms XForms reduces or eliminates the need for scripting XForms is a W3C Recommendation
Lecture-1
Cs.aiub.edu/~jitu
82
XML NAMESPACES
Lecture-1
Cs.aiub.edu/~jitu
83
Name Conflicts
In XML, element names are defined by the developer. This often results in a conflict when trying to mix XML documents from different XML applications. This XML carries HTML table information:
<table> <tr> <td>Apples</td> <td>Bananas</td> </tr> </table>
Lecture-1
Cs.aiub.edu/~jitu
84
Name Conflicts
This XML carries information about a table (a piece of furniture):
<table> <name>African Coffee Table</name> <width>80</width> <length>120</length> </table>
If these XML fragments were added together, there would be a name conflict. Both contain a <table> element, but the elements have different content and meaning. An XML parser will not know how to handle these differences.
Lecture-1
Cs.aiub.edu/~jitu
85
86
E4X
Lecture-1
Cs.aiub.edu/~jitu
87
What is E4X?
E4X is a new extension to JavaScript. E4X adds direct support for XML to JavaScript. E4X is official in the JavaScript 1.6 standard. JavaScript = ECMAScript
ECMAScript is the official name for JavaScript. ECMAScript is the same as JavaScript. ECMA (The European Computer Manufacturers Association) is the organization standardizing JavaScript.
88
Lecture-1
Cs.aiub.edu/~jitu
89
JQUERY
Lecture-1
Cs.aiub.edu/~jitu
90
What is jQuery?
jQuery is a library of JavaScript Functions. jQuery is a lightweight "write less, do more" JavaScript library. The jQuery library contains the following features:
Lecture-1
HTML element selections HTML element manipulation CSS manipulation HTML event functions JavaScript Effects and animations HTML DOM traversal and modification AJAX Utilities
Cs.aiub.edu/~jitu
91
TCP/IP
Lecture-1
Cs.aiub.edu/~jitu
92
What is TCP/IP?
TCP/IP is the communication protocol for communication between computers on the Internet. TCP/IP stands for Transmission Control Protocol / Internet Protocol. TCP/IP defines how electronic devices (like computers) should be connected to the Internet, and how data should be transmitted between them.
Lecture-1
Cs.aiub.edu/~jitu
93
Inside TCP/IP
Inside the TCP/IP standard there are several protocols for handling data communication:
TCP (Transmission Control Protocol) communication between applications UDP (User Datagram Protocol) simple communication between applications IP (Internet Protocol) communication between computers ICMP (Internet Control Message Protocol) for errors and statistics DHCP (Dynamic Host Configuration Protocol) for dynamic addressing
Lecture-1
Cs.aiub.edu/~jitu
94
Lecture-1
Cs.aiub.edu/~jitu
95
IP is Connection-Less
IP is for communication between computers. IP is a "connection-less" communication protocol. IP does not occupy the communication line between two computers. IP reduces the need for network lines. Each line can be used for communication between many different computers at the same time. With IP, messages (or other data) are broken up into small independent "packets" and sent between computers via the Internet. IP is responsible for "routing" each packet to the correct destination.
Lecture-1
Cs.aiub.edu/~jitu
96
TCP/IP
TCP/IP is TCP and IP working together. TCP takes care of the communication between your application software (i.e. your browser) and your network software. IP takes care of the communication with other computers. TCP is responsible for breaking data down into IP packets before they are sent, and for assembling the packets when they arrive. IP is responsible for sending the packets to the correct destination.
Lecture-1
Cs.aiub.edu/~jitu
97
HTTP
Lecture-1
Cs.aiub.edu/~jitu
98
What is HTTP?
The Hypertext Transfer Protocol (HTTP) is a networking protocol for distributed, collaborative, hypermedia information systems.
HTTP is the foundation of data communication for the World Wide Web. The standards development of HTTP has been coordinated by the Internet Engineering Task Force (IETF) and the World Wide Web Consortium
Lecture-1
Cs.aiub.edu/~jitu
99
Technical overview
Functions as a request-response protocol in the client-server computing model. a web browser, for example, acts as a client, while an application running on a computer hosting a web site functions as a server. The client submits an HTTP request message to the server. The server, which stores content, or provides resources, such as HTML files, or performs other functions on behalf of the client, returns a response message to the client.
Lecture-1
Cs.aiub.edu/~jitu
100
Technical overview
A response contains completion status information about the request and may contain any content requested by the client in its message body.
A client is often referred to as a user agent (UA). A web crawler (spider) is another example of a common type of client or user agent
The HTTP protocol is designed to permit intermediate network elements to improve or enable communications between clients and servers. HTTP is an Application Layer protocol designed within the framework of the Internet Protocol Suite
Lecture-1
Cs.aiub.edu/~jitu
101
Technical overview
HTTP Resources are identified and located on the network by Uniform Resource Identifiers (URIs)or, more specifically, Uniform Resource Locators (URLs)
Covered earlier
Lecture-1
Cs.aiub.edu/~jitu
102
Technical overview
Lecture-1
Cs.aiub.edu/~jitu
103
Request methods
HTTP defines nine methods (sometimes referred to as "verbs") indicating the desired action to be performed on the identified resource.
What this resource represents, whether pre-existing data or data that is generated dynamically, depends on the implementation of the server. Often, the resource corresponds to a file or the output of an executable residing on the server.
HEAD
Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content.
Lecture-1
Cs.aiub.edu/~jitu
104
Request methods
GET
Requests a representation of the specified resource.
POST
Submits data to be processed (e.g., from an HTML form) to the identified resource
PUT
Uploads a representation of the specified resource.
DELETE
Deletes the specified resource.
TRACE
Echoes back the received request, so that a client can see what (if any) changes or additions have been made by intermediate servers.
Lecture-1
Cs.aiub.edu/~jitu
105
Request methods
OPTIONS
Returns the HTTP methods that the server supports for specified URL
CONNECT
Converts the request connection to a transparent TCP/IP tunnel usually to facilitate SSL-encrypted communication (HTTPS)
PATCH
Is used to apply partial modifications to a resource
HTTP servers are required to implement at least the GET and HEAD methods and, whenever possible, also the OPTIONS method.
Lecture-1
Cs.aiub.edu/~jitu
106
Persistent connections
In HTTP/0.9 and 1.0, the connection is closed after a single request/response pair. In HTTP/1.1 a keep-alive-mechanism was introduced, where a connection could be reused for more than one request.
the client does not need to re-negotiate the TCP connection after the first request has been sent.
Lecture-1
Cs.aiub.edu/~jitu
107
Lecture-1
Cs.aiub.edu/~jitu