cs3101 internet programming ronald ssejjuuko. internet programming - chapter 002 course title...
TRANSCRIPT
CS3101
Internet Programming
Ronald Ssejjuuko
Internet Programming - Chapter 00 2
Course Title
Internet Programming
Course Code
CS3101 Credit Hours 4
Contact Hours
48 Core/Elective Core
Lecturer Ronald Ssejjuuko Tutorial Asst.
Phone 0703 051 973 Phone
Email [email protected] Email
3
Internet Programming
• Course web group and group email: https://groups.google.com/internet-programmers [email protected] Course website (To be designed by the class)
Lecture Times • Wed 9:00-11:00am(TP3)• Frid 10:00-12:00pm(TP3)
Internet Programming - Chapter 00 4
AIM
• Explain Internet/Web Programming concepts and related programming and scripting languages.
Internet Programming - Chapter 00 5
Course Description• Internet programming is one of the most exciting units
you can study at the university. Internet Programming examines programming models on both client and server sides.
• A web client is usually a browser, but may also be a custom application.
• The course introduces the practices of computer programming using languages common on the Internet, including XHTML, XML, SQL, JavaScript, and PHP, and Java or C #. Students learn how to structure pages with XHTML and CSS, how to program in JavaScript, Java and PHP, how to configure Apache and MySQL, how to design and query databases with SQL, and how to use Ajax with both XML and JSON.
Internet Programming - Chapter 00 6
Course Description
• The course explores issues of security, scalability, and cross-browser support and may also discuss enterprise-level deployments of websites.
• Students are expected to implement five projects and to design and implement a final course project (this starts with the proposal that has to be developed in the second week of the semester). In the final project students will create a web site that serves web pages and provides web services. The clients will be both browsers and custom applications.
Internet Programming - Chapter 00 7
Course Objectives
• At the end of this course, students will: • Have a general understanding of the fundamentals of the
Internet, WWW, browsers, TCP/IP, telnet, ftp, http, etc.• Have basic knowledge and experience with the major web
technologies. Existing and future technologies• Have insight into what constitutes a well-designed, usable
web application• Be able to solve various internet programming problems
and be innovative thinkers• Be able to apply the technologies with real business and
know how to manage a project
Internet Programming - Chapter 00 8
Required Readings
• JAVA• C# and the .Net framework• Database management systems• Internet, Networks, HTTP, FTP, TCT/IP • SQL Command• Software Engineering• UML (Optional)
Internet Programming - Chapter 00 9
Course Content Course Outline and Content Description
• Basic network and Internet concepts: TCT/IP, Servers, Web browsers, HTTP
• Static web content: HTML, CSS• Extensible markup: XML, XSL, XHTML• (1) Client-side scripting: JavaScript; (2) DHTML; (3) AJAX• Client-server web programming: Java applets and applications• (1) SQL; (2) Database access with JDBC; (2) Security and scalability• Thin-client applications: Java Servlets• Server-side scripting: PHP, JSP, ASP.NET with C#• (1) Enterprise Java Beans (Java EE); (2) wireless applications (Java
ME)• Distributed internet applications: JavaSpaces• Application interoperation: Web services
Internet Programming - Chapter 00 10
Weekly Schedule (Syllabus)
Week Topic Required Reading Assignments
1 Introduction & Internet Fundamentals
Sections 1.2 and 1.9, Chapter 1 from "Programming the World Wide Web". Project 1
2 Static web content Chapter 2 & 3 from "Programming the World Wide Web". XHTML & CSS Quiz 1
3 Generated web content XML, XSL Project 24 Client-side scripting JavaScript, DHTML, AJAX, Rails Quiz 2
5 Client-server web programming Java applets and applications, Ruby Project 3
6 Database access, Internet security JDBC Test 1
7 Thin-client applications Java Servlets Project 48 Server-side scripting PHP, JSP, ASP.NET, flash Quiz 3
9 Enterprise Java Beans, wireless applications Java ME, Java EE Project 5
10Application interoperation, Distributed internet applications
Web services, JavaSpaces Test 2
11 Project Implementation Software Final Project
12 Project Presentation Final Project Presentation
Internet Programming - Chapter 00 11
Assignment Explanations • Assignments will comprise of two tests and three quizzes
and the best test & two quizzes will contribute 20 points of the final mark and assignments/projects will contribute 15 points and the final project will be conducted throughout the semester which will contribute 15 points.
• Students will do a project that applies several of the technologies taught in the course. Each project is to be done by two/three students, and is due mid November. Project scope and topic are up to each group, but the mark will depend on size, complexity, and quality of each project. It is essential that the project is done entirely by the students submitting it.
Internet Programming - Chapter 00 12
Grading
• Tests & Quizzes 20%• Assignments 15%• Final Project 15%• Final Exam 50%• • Projects
Programming (course) website Finance and data Uganda UCU Clearing Application UCU map (Using Google Tools) Sports and other RSS feeds The King’s Menu Web Crawler (Movies, books, software etc)
Internet Programming - Chapter 00 13
Grading Cont’d• Final Project
• To be done in groups of 2 or 3.• Scoring..• Idea (Proposal)- 20%• Design Document - 20%• Implementation and documentation - 50%• Presentation - 10%
• Start thinking about your project now! • It is essential a) to attend all lectures and lab sessions, b) to actively listen and participate in all class activities, c) to read extensively on the topics covered and especially the assigned reading for the course, and d) prepare all assignments. At any moment during a lecture or lab session there may be a pop quiz.
Internet Programming - Chapter 00 14
Faith in Teaching
• Faith is one of the greatest and most necessary of God's gifts. To have faith means that you believe God's Word and then act upon it. ("And this is my prayer: that your love may abound more and more in knowledge and depth of insight, so that you may be able to discern what is best and may be pure and blameless until the day of Christ. . . ." Phil. 1:9-10. "Therefore, prepare your minds for action. -- 1 Peter 1:13a.)
Internet Programming - Chapter 00 15
Bibliography
• This course has no one particular textbook. However, the following principal reference book covers a good amount of the course material and is recommended to all students:
• Robert W. Sebesta, Programming the World Wide Web 2009, 5th edition, Pearson Education, 2010.
• Harvey M. Deitel & Paul J. Deitel, Internet & World Wide Web: How to Program, 4th Edition, 2008.
• Following additional reference books may also be useful: Simon Stobart & David Parsons, Dynamic Web Application
Development Using PHP and MySQL, ISBN 9781844807536 Craig D. Knuckles, David S. Yuen, Web Applications: Concepts & Real
World Design, John Wiley & Sons, ISBN 0-471-20458-7.
Internet Programming - Chapter 00 16
Web resources
• A good knowledge of Java or C++ or C# is assumed for this course. Students who need a thorough Java knowledge should refer to some of the many general Java books on the market, for example:
• David Flanagan, Java in a Nutshell, 5th edition, O'Reilly & Associates, 2005.
• Harvey M. Deitel & Paul J. Deitel, Java: How to Program, 7th edition, Prentice-Hall, 2007.
• Jim Farley, William Crawford, Prakash Malani, John Norman & Justin Gehtland, Java Enterprise in a Nutshell, 3rd edition, O'Reilly & Associates, 2005.
• Harvey M. Deitel, Paul J. Deitel & Sean E. Santry, Advanced Java 2 Platform: How to Program , Prentice-Hall, 2002.
Internet Programming - Chapter 00 17
Web resources
• Main JAVA Technology Site - http://java.sun.com• Documentation - http://java.sun.com/reference/docs/• Code Sample -
http://java.sun.com/developer/codesamples/• Tutorials - http://java.sun.com/developer/onlineTraining/
and http://java.sun.com/docs/books/tutorial/ • Netbeans - http://www.netbeans.org/ • Apache Tomcat - http://tomcat.apache.org/ • Apache AXIS - http://ws.apache.org/axis/ • MySQL - http://www.mysql.com/ • And many more
Internet Programming - Chapter 00 18
Web resources
• World Wide Web Consortium (http://www.w3.org/ )WWW standards body
• www.w3schools.com/ HTML, XHTML, CSS, JavaScript, XML, XSL, ASP, SQL,
ADO, VBScript, Tutorials, References, Examples, etc
• http://java.sun.com/docs/books/tutorial/• http://www.oracle.com/technetwork/java/jav
ase/tech/index-jsp-136101.html
Internet Programming - Chapter 00 19
Questions
• Why is html not a programming language?
Internet Programming - Chapter 00 20
Chapter 00
Introduction to the Internet
Slides based on: Programming the World Wide Web 2009 by Robert W. Sebesta and Internet & World Wide Web: How to Program by Deitel
Internet Programming - Chapter 00 21
A Brief Intro to the Internet• Origins
ARPAnet - late 1960s and early 1970s• Network reliability • For ARPA-funded research organizations
BITnet, CSnet - late 1970s & early 1980s• email and file transfer for other institutions
NSFnet - 1986 • Originally for non-DOD funded places• Initially connected five supercomputer centers• By 1990, it had replaced ARPAnet for non-military uses• Soon became the network for all (by the early 1990s)
NSFnet eventually became known as the Internet • What the Internet is:
A world-wide network of computer networks At the lowest level, since 1982, all connections use TCP/IP TCP/IP hides the differences among devices connected to the Internet
Internet Programming - Chapter 00 22
A Brief Intro to the Internet (continued)
• Internet Protocol (IP) Addresses Every node has a unique numeric address Form: 32-bit binary number
• New standard, IPv6, has 128 bits (1998) Organizations are assigned groups of IPs for their computers
• Domain names Form: host-name.domain-names First domain is the smallest; last is the largest Last domain specifies the type of organization Fully qualified domain name - the host name and all of the domain names DNS servers - convert fully qualified domain names to Ips
• Problem: By the mid-1980s, several different protocols had been invented and were being used on the Internet, all with different user interfaces (Telnet, FTP, Usenet, mailto)
Internet Programming - Chapter 00 23
The World-Wide Web• A possible solution to the proliferation of different protocols
being used on the Internet• Origins
Tim Berners-Lee at CERN proposed the Web in 1989• Purpose: to allow scientists to have access to many databases of
scientific work through their own computers Document form: hypertext Pages? Documents? Resources?
• We’ll call them documents Hypermedia – more than just text – images, sound, etc.
• Web or Internet? The Web uses one of the protocols, http, that runs on the
Internet--there are several others (telnet, mailto, etc.)
Internet Programming - Chapter 00 24
Web Browsers• Mosaic - NCSA (Univ. of Illinois), in early 1993
First to use a GUI, led to explosion of Web use Initially for X-Windows, under UNIX, but was ported to other
platforms by late 1993
• Browsers are clients - always initiate, servers react (although sometimes servers require responses)
• Most requests are for existing documents, using HyperText Transfer Protocol (HTTP)
• But some requests are for program execution, with the output being returned as a document
Internet Programming - Chapter 00 25
Web Servers
• Provide responses to browser requests, either existing documents or dynamically built documents
• Browser-server connection is now maintained through more than one request-response cycle
• All communications between browsers and servers use Hypertext Transfer Protocol (HTTP)
• Web servers run as background processes in the operating system Monitor a communications port on the host, accepting
HTTP messages when they appear
Internet Programming - Chapter 00 26
Web Servers (continued) • All current Web servers came from either
1. The original from CERN2. The second one, from NCSA
• Web servers have two main directories:1. Document root (servable documents)2. Server root (server system software)
• Document root is accessed indirectly by clients Its actual location is set by the server configuration file Requests are mapped to the actual location
• Virtual document trees • Virtual hosts
Internet Programming - Chapter 00 27
Web Servers (continued)
• Proxy servers• Web servers now support other Internet
protocols• Apache (open source, fast, reliable)
Began as the NCSA server, httpd Maintained by editing its configuration file
• IIS Maintained through a program with a GUI
interface
Internet Programming - Chapter 00 28
URLs• General form: scheme:object-address
The scheme is often a communications protocol, such as telnet or ftp
• For the http protocol, the object-address is: fully qualified domain name/doc path
• For the file protocol, only the doc path is needed• Host name may include a port number, as in zeppo:80 (80 is
the default, so this is silly)• URLs cannot include spaces or any of a collection of
other special characters (semicolons, colons, ...)• The doc path may be abbreviated as a partial path
The rest is furnished by the server configuration• If the doc path ends with a slash, it means it is a directory
Internet Programming - Chapter 00 29
Multipurpose Internet Mail Extensions (MIME)
• Originally developed for email• Used to specify to the browser the form of a file returned by the
server (attached by the server to the beginning of the document)
• Type specifications Form: type/subtype Examples: text/plain, text/html, image/gif, image/jpeg
• Server gets type from the requested file name’s suffix (.html implies text/html)
• Browser gets the type explicitly from the server• Experimental types
Subtype begins with x- e.g., video/x-msvideo Experimental types require the server to send a helper
application or plug-in so the browser can deal with the file
Internet Programming - Chapter 00 30
The HyperText Transfer Protocol• The protocol used by ALL Web communications
Request Phase• Form:
HTTP method domain part of URL HTTP ver.Header fields blank lineMessage body
• An example of the first line of a request:GET /cs.uccp.edu/degrees.html HTTP/1.1
• Most commonly used methods:GET - Fetch a documentPOST - Execute the document, using the data in bodyHEAD - Fetch just the header of the documentPUT - Store a new document on the serverDELETE - Remove a document from the server
Internet Programming - Chapter 00 31
The HyperText Transfer Protocol (continued)
• Four categories of header fields: General, request, response, & entity
• Common request fields: Accept: text/plain Accept: text/*
If-Modified_since: date• Common response fields:
Content-length: 488
Content-type: text/html• Can communicate with HTTP without a browser
> telnet blanca.uccs.edu httpGET /respond.html HTTP/1.1Host: blanca.uccs.edu
Internet Programming - Chapter 00 32
The HyperText Transfer Protocol (continued)
• Response Phase Form:
Status line Response header fields blank line Response body
Status line format: HTTP version status code explanation Example: HTTP/1.1 200 OK (Current version is 1.1) Status code is a three-digit number; first digit specifies the general status 1 => Informational 2 => Success 3 => Redirection 4 => Client error 5 => Server error The header field, Content-type, is required
Internet Programming - Chapter 00 33
The HyperText Transfer Protocol (continued)
• An example of a complete response header:HTTP/1.1 200 OKDate: Tues, 18 May 2004 16:45:13 GMTServer: Apache (Red-Hat/Linux)Last-modified: Tues, 18 May 2004 16:38:38 GMTEtag: "841fb-4b-3d1a0179"Accept-ranges: bytesContent-length: 364Connection: closeContent-type: text/html, charset=ISO-8859-1
• Both request headers and response headers must be followed by a blank line
Internet Programming - Chapter 00 34
Security
• There are many kinds of security problems with the Internet and the Web
• One fundamental problem is getting data between a browser and a server without it being intercepted or corrupted in the process
• Security issues for a communication between a browser and a server:1. Privacy2. Integrity3. Authentication4. Nonrepudiation
Internet Programming - Chapter 00 35
Security
• The basic tool to support privacy and integrity is encryption If the sender and the receiver both use the same
encryption key, the key must be transmitted from the sender to the receiver
Solution: (1976, Diffie and Hellman)• Public-key encryption• Use a public/private key pair
– Everyone uses your public key to encrypt messages sent to you– You decrypt them with your matching private key– It works because it is virtually impossible to compute the private
key from a given public key
Internet Programming - Chapter 00 36
Security
• RSA is the most widely used public-key algorithm
• Another security problem: destruction of data on computers connected to the Internet Viruses and worms
• Yet another common security problem: Denial-of-Service (DoS) Created by flooding a Web server with requests
Internet Programming - Chapter 00 37
The Web Programmer’s Toolbox
• XHTML To describe the general form and layout of documents An XHTML document is a mix of content and controls
• Controls are tags and their attributes– Tags often delimit content and specify something about how the
content should be arranged in the document– Attributes provide additional information about the content of a
tag
Tools for creating XHTML documents• XHTML editors - make document creation easier
– Shortcuts to typing tag names, spell-checker,
• WYSIWYG XHTML editors– Need not know XHTML to create XHTML documents
Internet Programming - Chapter 00 38
The Web Programmer’s Toolbox (continued)
• Plug ins Integrated into tools like word processors, effectively converting them
to WYSIWYG XHTML editors• Filters
Convert documents in other formats to XHTML• Advantages of both filters and plug-ins:
Existing documents produced with other tools can be converted to XHTML documents
Use a tool you already know to produce XHTML • Disadvantages of both filters and plug-ins:
XHTML output of both is not perfect - must be fine tuned XHTML may be non-standard You have two versions of the document, which are difficult to
synchronize
Internet Programming - Chapter 00 39
The Web Programmer’s Toolbox (continued)
• XML A meta-markup language Used to create a new markup language for a particular purpose or
area Because the tags are designed for a specific area, they can be
meaningful No presentation details A simple and universal way of representing data of any textual kind
• JavaScript A client-side XHTML-embedded scripting language Only related to Java through syntax Dynamically typed and not object-oriented Provides a way to access elements of XHTML documents and
dynamically change them
Internet Programming - Chapter 00 40
The Web Programmer’s Toolbox (continued)
• Flash A system for building and displaying text, graphics, sound,
interactivity, and animation (movies) Two parts:
1. Authoring environment2. Player
Supports both motion and shape animation Interactivity is supported with ActionScript
• Java Web Software Servlets – server-side Java classes JavaServer Pages (JSP) – a Java-based approach to server-side
scripting• An alternative to servlets
JavaServer Faces – adds an event-driven interface model on JSP
Internet Programming - Chapter 00 41
The Web Programmer’s Toolbox (continued)
• PHP A server-side scripting language An alternative to CGI Similar to JavaScript Great for form processing and database access through the Web
• Ruby A pure object-oriented interpreted scripting language Every data value is an object, and all operations are via method
calls Most operators can be redefined by the user Both classes and objects are dynamic Variables are all type-less references to objects
Internet Programming - Chapter 00 42
The Web Programmer’s Toolbox (continued)
• ASP.NET Does what JSP and JSF do, but in the .NET environment - Allows any .NET language to be used as a server-side
scripting language - ASP.NET documents are compiled into classes
• Ruby Object-oriented interpreted scripting language A pure OOL – every data value is an object Basic operations are defined as methods Dynamically typed Objects have types, but variables do not
Internet Programming - Chapter 00 43
The Web Programmer’s Toolbox (continued)
• Rails A development framework for Web-based applications Particularly useful for applications that access databases Written in Ruby and uses Ruby as its primary user language Based on the Model-View-Controller architecture
• Ajax Asynchronous JavaScript + XML
• No new technologies or languages Much faster for Web applications that have extensive user/server
interactions Uses asynchronous requests to the server Requests and receives small parts of documents, resulting in
much faster responses