Web Programming

CSC 210, Spring 2014

Architecture

Software Architecture is a high level design discipline that designs program modules and the interfaces between these modules. By designing modules and interfaces, architecture gives a great deal of control of the complexity of programming. Module developers need only concern themselves with the calls on their interface and the behavior of the program given those calls. This is still plenty cXSomplicated, so all of the techniques of software development are needed even when one has a good architecture in place.

All of the proposals will require a three layer architecture. (Actually, it is hard to think of a web project that does not require a three layer architecture, so this is unsurprising.) The three layers are:

The user interface is usually called the front end (in web programming it is handled on the client) whereas the Business Logic and Database are the back end (i.e. handled by the server)

User Interface

The user interface is the part of the computer program that interacts with the user. The user is part of the real world and is therefore hard for the computer to deal with. The user can provide input at any time and expects output as soon as he or she has finished. User interface programming involves dealing with events. That is, the user's actions are packaged by the browser into events which can are processed by event handlers. This input may change only the user interface (i.e. they are captured by JavaScript, which changes the HTML or CSS) or they may require a request for information from the server.

In this class, the user interface is displayed by the browser. It is produced by a combination of the HTML, CSS, and JavaScript. All of the stuff that actually makes it to the browser--that is sent by the server in response to a request--is part of the user interface. This part of the program is often called the front end.

This course covers the development of the User Interface for web programs, but it is not a user interface design course. We will touch on the topic, but CSC 212 is the course in which this aspect of programming is dealt with. Those teams with members who have already taken CSC 212, should be able to produce better user interfaces by using the techniques taught in that course. Most teams have picked topics they are familiar with so you intuitions should be good enough for this class.

Business Logic

The business logic of the program is what is usually taught in programming classes. It takes input as managed by the user interface and produces output that is presented by the user interface. It follows the usual input, processing, output flow. It is protected from the vagaries of the real world by the front end. It is best if the business logic runs entirely on the server, but occasionally business logic is moved onto the client for performance reasons. Moving business logic to the client greatly increases the the difficulty of building, debugging and maintaining the code, but sometimes it is the only solution. The cost of putting business logid on the client makes it a choice of last resort.

So far, the business logic we have seen has been written in PHP. This code, thought it is included on the web page, runs on the server. It generated a new web page when it runs and deliveres that web page to the user. There are other server side programming paradigms that rely on different langauges. For example, Ruby on Rails, is a server side development system in Ruby and JBoss is a server side development system for Java. There are many more.

A main focus of this course is on server side programming, so we will likely spend a lot of the rest of the semester talking about it and other paradigms for server side programming.

Database

The database stores all of the data the system uses. Most modern programs are built on top of a database and those which are not could probably be improved by using a database. Technically, the database is the collection of data that the program uses and very few program have no data associated with them. However, generally, when we talk about database we mean data managed by a DBMS (Database Management System). The system we will be using, and which many if not most web programs use is MySql. It is part of the standard AMP architecture (Apache, MySql, PHP) used by most web site. (We often talk of LAMP (Linux AMP), WAMP (Windows AMP), or MAMP (Mac APM). In fact, you can install an AMP on your own computer without a lot of dificulty. Pointers to instructions for installing an AMP on your computer are available from the web site for CSC 296.

DBMSes are difficult to program. CSC 296: Database Systems is the course at UR which introduces you to this topic. If anyone on your team has taken the course, you will have a big leg up in developing your project. You may also recruit someone from the current version of the course to do the database design for the course. I am working with Dr Koomen, which is teaching the course this semester, and he is interested in giving his students the opportunity to work with a real web programming. Back end programming, is not nearly as interesting if there is no front end to display the information, but his course does not involve front end programming. So by using someone from that course, you will have the opportunity to learn more about database programming and the course that teaches it. You may decide to take the course yourself.

Please email Nat Martin at martin@cs.rochester.edu with questions.

Valid XHTML 1.0 Transitional Valid CSS!