Background on the Web
- The Web is a client-server network.
- Pages are stored on Web servers.
- A page is retrieved by the client's browser from a server, and
displayed on the client-side.
What about Web Programming?
- Code can be attached to a page, which is executed on the browser
(i.e. on the client-side). Java is a client-side programming language.
- Code can be added to a server, so that when a request comes
from a browser (e.g. get_page), then the server can execute
the program. This is called server-side programming. The most
common server-side programming mechanism is CGI, which can utilise
many kinds of languages (e.g. C, Perl, Prolog).
Client-side or Server-side Programming?
Each approach has advantages and disadvantages.
Advantages of Client-side Programming (e.g. with Java):
- Code is downloaded and executed locally. There are no network
overheads caused by its execution.
- Code can utilise features of the browser (e.g. its history list).
Disadvantages:
- Security (someone else's code is running on your machine).
- Not suitable for all applications, such as databases, where there
needs to be centrally stored information.
Advantages of Server-side Programming (e.g. with CGI and C):
- The server can monitor users (e.g. it can collect usage
statistics).
- The server can control users (e,g, it can stop certain users
from accessing information).
- It is suitable for applications with centralised information (e.g.
databases).
- In general, it is easier to write server-side programs than client-side
ones.
Disadvantages:
- The server must do all the processing for each client request, and so
it can become a bottleneck.
- Server-side programs typically have less sophisticated user
interfaces than client-side programs.
Back to the Main Lab Page