CS437/637 - Database-backed Websites and Web Services, Fall 2018

Welcome to CS437/637 Fall 2018

This class will cover database-backed web sites and web services using SQL and PHP as the main programming languages. You need good programming skills and CS430/630 for SQL, or an equivalent introductory database course covering SQL, E-R diagrams, and client programming (in C, Java or PL/SQL). It is good to know basic HTML, including forms, but these topics will be covered quckly. There are plenty of tutorials for HTML on the Web.

Class meets MW 4:00-5:15pm in W-1-019
Professor: Betty O'Neil (eoneil at cs.umb.edu)
Office Hours: MW 3:30-3:45 and 5:30-6:45 in S-3-169
Grader: TBD

Homework and Programming Assignments: Prerequisites: CS310, CS430/630 (these are important), and officially, CS451/651 for CS637 only (less important, can be replaced by programming experience). Note that CS310 is an implicit requirement for all (applied) CS graduate courses. It means you need to know data structures, preferably implemented in Java (C++ is also OK), including use of Collection classes like HashMap. However, if you are solid on intermediate Java, as covered in cs210, that should be sufficient for this class.

Note that I also teach CS436/636 Database Application Development, usually in the fall. You may take both classes if you wish. Both classes use databases for holding persistent data and use HTML5 for web UI, so there is some overlap. It's best to take cs637 before cs636, since it is easier. Here is a quick comparison of these classes:

CS436/636 CS437/637
use Java for business logic use PHP for business logic
requires Java expertise (cs310 or equivalent) requires intermediate Java (cs210 or equivalent)
focus on large or enterprise sites focus on smaller sites
basic HTML5, minimal CSS more HTML5, CSS
layered architecture (presentation/service/DAO) simpler sites, less layering emphasis
use MVC (Model/View/Controller) pattern for web UI use MVC (Model/View/Controller) pattern for web UI
use Oracle or mysql interchangeably use mysql
default to using eclipse IDE default to using NetBeans IDE
run your own tomcat application server run XAMPP, your own Apache webserver, mysql, PHP site
only discuss web services study and implement web services

Note: If you are interested in preparing to use .NET, you should probably take CS436/636, since .NET is an enterprise platform, like JEE.

Syllabus

Student Information sheet, with list of essential skills needed for this course

Texts: print editions required for open-book exam use

Murach's PHP and MySQL (2nd or 3rd Edition) by Joel Murach and Ray Harris, Murach & Assoc, 2014, available for example at Amazon (older edition (less expensive), newer edition) or the bookstore. This book cover basic web technology (HTTP), running XAMPP for your own PHP web server, using the MySQL database. Follow the book link for free code.

HTML and CSS: Design and Build Websites by Jon Duckett, under $20 at Amazon. Follow the book link for free code.

Recommended for HTML and CSS, including slightly more advanced CSS examples:
Learning Web Design, by Jennifer Robbins, O'Reilly, about $40.

Getting Ready:
Check out your development PC: A Windows 7 system with at least 2GB of memory works well with these tools. Windows 8 or 10 is fine. Alternatively, a Linux system or recent MacOSX system will work well. Setup directions are provided for Windows, Linux, and MacOSX, in the Appendixes of the text. Also see "Access to cs.umb.edu systems" linked below under Resources.

First week: Get a UNIX/Linux account for cs637 by running apply, even if you already have a UNIX account here. This will give you access to our Linux host topcat.cs.umb.edu, which has a MySQL installation and an Apache web server enabled for PHP. You can try out the book's examples even before you get an account: see the link below under Resources.

Slides, etc. Final versions are posted after class

Note that slides are protected: username cs637, password supplied in class

Wed., Sept. 5 slides (6pp) Intro, start on HTML
Mon., Sept. 10 slides (6pp) HTML Links, Images, Tables, Forms (Ch 4-7 of Duckett)
   noon: Mysql accounts made for 10 students with class accounts.
Wed., Sept. 12 slides (6pp) HTML Video/Audio, Intro CSS, Color, Text (Ch 8-12 of Duckett)
Fri., Sept. 14: last two mysql accounts made
Mon., Sept 17 slides (6pp) CSS (Ch 13-15,17 of Duckett)
Wed., Sept. 19 slides (6pp) Chap. 2 of M&H: Intro to PHP
Mon., Sept. 24 slides (6pp) More on URLs, forms slides (6pp) Chap. 3: Intro to Mysql
Wed., Sept. 26 slides (6pp) Intro to Pizza Project slides (6pp) Chap. 4: Using PHP with Mysql
Mon., Oct 1 slides (6pp) Chap5: MVC apps
Wed., Oct 3 Chap. 5, continued
Fri., Oct 5: piazza invitations should be in your preferred email inbox (.forward address or for 2 students without .forward files, info sheet entry)
Let me know by email if you haven't received an invitation.

Mon., Oct. 8 Holiday 
Wed., Oct 10 slides (6pp) Chap. 6 Debugging and Errors slides (6pp) Chap. 7 Forms
Mon., Oct. 15 Chap. 7 Forms, continued, slides (6pp) Chap. 8 Control Statements, type coercion
Wed., Oct. 17 slides (6pp) Chap. 9 Strings, Numbers slides (6pp) Chap. 11 Arrays slides (6pp)
Mon., Oct. 22 Arrays, continued, slides (6pp) Chap. 12 Session Variables
Wed., Oct. 24 Sessions, continued, slides(6pp) Chap. 13 Functions
Mon., Oct. 29 Functions, continued, slides (6pp) Chap. 14 Objects
Wed., Oct. 31 Objects, continued
Mon., Nov. 5 slides (6pp) Midterm Review
Wed., Nov. 7 Midterm Exam
Practice Midterm Exam (solution
Wed., Nov. 14 Chap. 14 Objects, concluded
Mon., Nov. 19 slides (6pp) Chap. 20 Larger Websites
Wed., Nov. 21 no class
Mon., Nov. 26 slides (6pp) PHP Web Services
Wed., Nov. 28 slides (6pp) PHP Web Services, part 2
Mon., Dec. 3 slides (6pp) More on HTTP slides (6pp) Debugging Proj2
Wed., Dec. 5 slides (6pp) PHP Web Services, part 3 slides (6pp) Chap. 21 Secure Web Sites
Mon., Dec. 10 slides (6pp) Chap. 24 an eCommerce Website
Wed., Dec. 12 slides (6pp) Final Review, (slides) (6pp) Project 2 Review, teacher evaluations

Final Exam Wed., Dec. 19 3:00-6:00pm in room in room W-2-158 (note room change)
Practice Final Exam (Solution)


Assignments:

Homework 1 SQL review, HTTP, HTML5 part 1, mysql, php, setup. Due Monday, Sept. 17, in class, on paper. Solution
Homework 2 HTML5, CSS, PHP Netbeans project, Smartphones. Due Monday, Oct. 1, in class, on paper Solution
Homework 3 Pizza Project, Page Flows, Comm Diagrams, more SQL. Due Monday, Oct. 15, in class, on paper. Solution
Homework 3x: Pizza Project first delivery: see problem 7 of Homework 3. Due Tuesday, Oct. 16 by midnight in your /var/www/html/cs637/username/pizza1 directory

Pizza Project: doc assignment pizza1_setup.zip (deployed) Solution (zipped)
Final delivery due Sunday, Oct. 28 by midnight, in your /var/www/html/cs637/username/pizza1 directory on topcat.

Homework 4 Arrays, pizza1 Solution, session variables, intro objects. Due Mon. Nov. 26 in class, on paper. Solution
Homework 5 HTTP, start on Project 2. Due Wed., Dec. 5 in class, on paper. Solution

Project 2: B to B Web Services for the Pizza Shop assignment images proj2_setup.zip Due Monday, Dec. 10 by midnight.
pizza2 deployed get product 1 by GET to http://topcat.cs.umb.edu/cs637/eoneil/proj2_server/rest/products/1
Solution (zip) (deployed)


Resources

Piazza Class Site: post questions here!

Home page for Spring, 2018

Access to cs.umb.edu systems from offsite Logging in and transferring files. (Updated Feb. 1 to remove unnecessary Oracle info.)

Development Setup Installing needed software. Some discussion of topcat.cs.umb.edu as well.

The book webapps deployed on topcat.cs.umb.edu and using the MySQL database on topcat.cs.umb.edu

HTML5: Intro at www.w3schools.com latest spec forms tutorial tag reference, with HTML 4/5 info  HTML5 validator

CSS3: Intro at www.w3schools.com CSS2.2 property index. More on CSS: mozilla.org  css-tricks.com

HTTP : tutorial

This course does not cover Javascript, but it is very important today, especially for apps that need to run on smartphones.

MySQL We are using MariaDB (compatible with mysql 5.5, 5.6) bundled with XAMPP, and also version 5.6 on topcat.cs.umb.edu. docs (SQL)

PHP The version of PHP is important to note because it is still evolving, although not significantly between versions 5.5 and 5.6, and version 7 handles version 5.5 code properly in almost all cases. We are using version 7 bundled with XAMPP, and version 5.5 on topcat.cs.umb.edu. Our second edition text uses version 5.5, and the third edition uses version 7.1 (see pg. 12 in either edition). docs evolving spec

PHP Internals: How Variables and References Work

PHP Debugging Setup and Use Note that the directions on setting up XDebug in the Appendices of  the second edition of M&H apply only for older versions of XAMPP.

PHP Debugging Session: video 

REST Web Services Tutorial