Dr Andres Baravalle
This module will provide students the core theoretical and practical background necessary for multi-tier web applications development.
At the end of this module, students will be able to:
Each week:
On week 1, there will be no workshop. On week 2, the workshop will cover installation and set up of the development environment.
Starting from week 3, you will work on the activities included in the lecture slides.
Your module handbook is on your Virtual Learning Environment (VLE) and contains general information on this module and the module team.
All the support material will be released as web-based slides (read here why).
Please familiarise yourself with the handbook.
The core textbook for this module is:
By the end of the year you should have studied all the sections in the book outlined in the module handbook.
You should have already some good experience in web development, and you should be able to:
In this module we build on the learning outcomes that you achieved during your year 1 web development and programming modules, trying to move one step further.
The module schedule is available here.
Castro, E. (2007) HTML, XHTML & CSS: visual quickstart guide. 6th ed. London: Pearson Education.
Meyer, E.A. (2007) CSS: the definitive guide. Farnham: O'Reilly.
Musciano, C. and Kennedy, B. (2006) HTML and XHTML: the definitive guide. Beijing; Cambridge, Mass.: O'Reilly.
You are going to be doing web applications programming for 24 weeks.
You are not going to use, at any point, point and click development environments.
Since the advent of the World Wide Web (WWW) much of the focus in computing has been on technologies that work with, or on, the World Wide Web. This includes W3C technologies as HTML, CSS and XML (that work on the web) but also programming languages as Java, Python, Ruby - the allow to build applications that rely on - or use - the World Wide Web.
These technologies can be grouped (by function) into three main layers:
At this point, it would be useful to summarise the more important WWW technologies, and in which layers they operate.
Please note that any technology can be used in different ways; we are now focusing on the more common uses of the technologies.
Some of the technologies focus on just one of the layers that we have identified:
Some of the technologies focus on two groups of function (typically, structuring content and managing the presentation layer):
A number of languages implement features of all three layers:
An architecture relates to the design of a complete system:
Client–server-based architectures represent the mainstream conceptual framework underlying the design of most web applications.
Understanding the basic principles and range of possibilities is fundamental to designing any new application.
The simplest ‘client–server’ architecture consists of just two components: a client and a server.
An example of a client server architecture is a database application with clients that can access the data. For example, you can store your data (e.g. customer addresses) in a MySQL server and use a desktop application to perform operations on the data - e.g. input, extract or manipulate the data.
Modern web architectures are typically based on 3 tiers:
In a three-tier architecture, the application is not responsible for the business logic nor for the storage of data, which will be addressed in the other layers.
The presentation tier "displays information related to such services as browsing merchandise, purchasing and shopping cart contents. It communicates with other tiers by outputting results to the browser/client tier and all other tiers in the network. (In simple terms it's a layer which users can access directly such as a web page, or an operating systems GUI)".
The application tier "is pulled out from the presentation tier and, as its own layer, it controls an application’s functionality by performing detailed processing".
The data tier is where "information is stored and retrieved. This tier keeps data neutral and independent from application servers or business logic. Giving data its own tier also improves scalability and performance".
N-tier architectures are build by breaking up an application into further tiers.
This allows both to re-use existing software and components, and improves maintainability by allowing to modify specific tiers only (e.g. replacing a Oracle database with a MySQL database would require just rewriting the "Data Access" tier)
This course will enable you to build dynamic web sites and web applications based on (part of) the LAMP/WAMP stacks (a n-tier architecture).
We will start with an introduction to the main elements of the software stack that we will be using:
Web servers are in charge of delivering static HTML pages and any additional content needed in the page to the clients.
When a web server receives a request for an URL (uniform resource locator), the web server will try to locate the request on the file system and send it to the client.
Here is what a simple HTTP request looks like (short screencast here):
telnet mastodon.uel.ac.uk 80
Trying 161.76.74.2...
Connected to mastodon.uel.ac.uk.
Escape character is '^]'.
GET / HTTP1.0
The web server - as we can see from the previous example - listens on port 80.
This simple request is asking the web server to return the default index page in the root of the web server mastodon.uel.ac.uk. The web server will look in the default folder (in this specific case, /var/www/html
) for the default index page (index.html
) and return its content using TCP/IP.
Apache is one of the most popular web server, year after year (according to Netcraft's survey), with about 51% of the total number of activer web sites in the web.
MySQL is one of the world's most widely used databases, and the most popular Open Source database server.
MySQL supports a broad subset of ANSI SQL 99, as well as extensions. By default, it ships with no GUI, and is normally administered either from the command line or with third-party tools as phpMyAdmin.
In reality you will not be using MySQL (at least for most of this module). Most of you are not familiar enough with database technologies - so during this module you'll be focusing on web applications with PHP.
After you learn databases, you'll then be able to go back to PHP and learn how to build applications using the full extent of the LAMP/WAMP stack.
Most code snippets you will find on-line are for PHP + MySQL. That's another reason for not using MySQL on this module - you will have no alternative but to write your own code.
PHP is a Open Source server-side scripting language; you will be using PHP to develop web scripts and applications.
Apache, MySQL and PHP are all examples of free and open source software.
Free and open source software is software released under a license that guarantees to its users the:
Software that does not give you those rights is usually called proprietary. Free Software and Open Source, when used to denote software, are (mostly) synonyms used by different groups.
Free to use means that Open Source software can be used without restrictions.
It does not mean “free as in free beer”. Free is as in the French and Spanish libre (and Portuguese livre). It means that there are no discriminations on different types of use.
The most popular Open Source licenses are:
License | Notable software |
---|---|
BSD | Most of FreeBSD and OpenBSD (including OpenSSH) |
GPL | The Linux kernel, MySQL, PHP |
LGPL | Mostly used for libraries, e.g. GNU C |
We will be using PHP, running on Apache, to program web applications - working on the interaction layer.
We will explore the main language constructs in PHP and you will learn how to use PHP to build web applications.
These are some resources you can use for a more in-depth study:
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License (what does it mean? you can copy/modify/redistribute this content).