9. Client Server Model
✤ Why client server?
✤ alternatives?
✤ basis of all distributed computing paradigms
Thursday, 13 June 13
10. Client Server Model
✤ Why client server?
✤ alternatives?
✤ basis of all distributed computing paradigms
✤ service-oriented, based on a request response protocol
Thursday, 13 June 13
11. Client Server Model
✤ Why client server?
✤ alternatives?
✤ basis of all distributed computing paradigms
✤ service-oriented, based on a request response protocol
✤ requires two distinct entities, a client and a server
Thursday, 13 June 13
12. Client Server Model
✤ Why client server?
✤ alternatives?
✤ basis of all distributed computing paradigms
✤ service-oriented, based on a request response protocol
✤ requires two distinct entities, a client and a server
✤ problems?
Thursday, 13 June 13
13. WebTechnologies
✤ interconnected computers : Internet
✤ interconnected, distributed knowledge : Hypertext
✤ language to express, hypertext : HTML
✤ tags
✤ links
✤ client :web-browser,
✤ server : web-server,
✤ protocol: Hyper Text Transfer Protocol
Thursday, 13 June 13
14. HTTP
✤ Request
✤ the url
✤ protocol
✤ host/domain,[port]
✤ path, parameters
✤ methods:
✤ GET, POST, PUT,DELETE
✤ HEAD, OPTIONS, TRACE...
✤ Cookies!
GET /index.html HTTP/1.1
Host: www.example.com
Thursday, 13 June 13
15. HTTP
✤ Response
✤ Status codes
✤ Response headers
✤ content type
✤ content length
✤ Response data
✤ Cookies!
Thursday, 13 June 13
16. HTTP
✤ Response
✤ Status codes
✤ Response headers
✤ content type
✤ content length
✤ Response data
✤ Cookies!
HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 131
Connection: close
<html>
<head>
<title>An Example Page</title>
</head>
<body>
Hello World, this is a very simple HTML
document.
</body>
</html>
Thursday, 13 June 13
17. HTTP
✤ Salient Properties:
✤ Idempotent, except for POST
✤ multiple calls should result in the same state
✤ Stateless
✤ why?
✤ problems?
Thursday, 13 June 13
18. HTTP Sessions
✤ Cookies to the rescue!
✤ Types
✤ session
✤ persistent
✤ secure
✤ third-party cookie
✤ super cookie
✤ Server --> Client
✤ Client --> Server
HTTP/1.1 200 OK
Content-type: text/html
Set-Cookie: name=value
Set-Cookie: name2=value2; Expires=Wed, 09 Jun 2021
10:18:14 GMT
(content of page)
GET /spec.html HTTP/1.1
Host: www.example.org
Cookie: name=value; name2=value2
Accept: */*
Thursday, 13 June 13
19. HTML
✤ The language of the internet?
✤ distributed information bank
✤ tag based structure
✤ links to other html documents
✤ styling provided through css
✤ latest versions HTML 5, CSS 3
✤ move from hypertext to hypermedia
<!DOCTYPE HTML>
<html>
<body>
<video width="320" height="240" controls>
<source src="movie.mp4" type="video/mp4">
<source src="movie.ogg" type="video/ogg">
Your browser does not support the video
tag.
</video>
</body>
</html>
Thursday, 13 June 13
21. CGI
✤ basis of server side dynamism
✤ route the request from client to a server-side script
✤ let the script generate the response
✤ CGI can be anything
✤ perl, bash script
✤ C program
✤ Java, python or ruby
Thursday, 13 June 13
22. Java on the Server
✤ harness the power of java on the server side
✤ Java Servlets
✤ JSP: templates for java
✤ Enter frameworks
✤ struts
✤ spring
✤ MVC
Thursday, 13 June 13
23. Java on the Server
✤ harness the power of java on the server side
✤ Java Servlets
✤ JSP: templates for java
✤ Enter frameworks
✤ struts
✤ spring
✤ MVC
Thursday, 13 June 13
24. Web Application
✤ web page --> web app
✤ an interactive front-end
✤ enter applet,vbscript,javascript,....
✤ HTML as DOM
✤ Ajax/XHR
✤ frameworks : jQuery, backbone.js, ember.js, angular.js, knockout.js
Thursday, 13 June 13
25. Persistence
✤ Flat files --> Databases
✤ Relational Databases
✤ NoSQL
✤ No more 1 size fits all
✤ JDBC
✤ ORM : Hibernate
Thursday, 13 June 13