Chapter 28 Web programming
EXERCISES
28-1 What is a document markup language? What is the fundamental difference between HTML and XML?
A language that is inserted into the body of the text of the document to indicate the structure and type of its components. HTML (hypertext markup language) is mostly to indicate how a document should be displayed in a browser. XML (extensible markup language) does not indicate formatting at all butonly structure and component type
28-2 How is the information on how to display an XML document conveyed to a browser?
An XML document contains no formatting indications. These are stored in a separate, related document called a DTD (document type description).
28-3 How is a website managed by a server inside a firewall made available for public access?
Incoming communication is intercepted and that desined for port 80 of the IP address of the webserver is allowed through.
28-4 Discuss naming with respect to the Web: How are unique names created for documents? What happens when a web page is moved from one directory to another? Give examples of where caching might usefully be used?
Although URIs are defined for all types of documents that might be displayed on the Web, document names in practice build on DNS domain naming. A document URL (after the protocol specification) is a pathname which starts with the domain name of the web service (pathname or IP address) followed by the pathname of the given document (page) within the web service?s filing system. If a page is moved within this filing system its name changes and any links to it become invalid. It is customary to leave a forwarding link at the old location for some time. Caching is most useful when documents change infrequently and when the original source is heavily loaded.
28-5 Criticise the original design of the HTTP protocol. How has it been improved over the years?
HTTP originally set up and tore down TCP connections for every client-service interaction. Later versions allowed a TCP connection between a client and server to be used for many interactions until an entire document with all its components has been transferred.
28-6 How is user interaction added to the basic functionality of displaying a document? How is such an interaction made secure, for example, for transmitting credit card details?
The user can be required to fill in a form before a page is displayed or its display is completed. For example, a user name and password may have to be supplied by the client in order to access some object. These may have been distributed by email. When sensitive data is to be transmitted from client to server it is essential that the data is encrypted. SSL (secure socket layer) see Chapter 8, is commonly used for this purpose.
28-7 How are animations made part of documents and how are they executed when the document is displayed?
The document can include appropriately marked up scripts and programs (applets). These can be used to create animations when the client browser interprets or executes them.
28-8 Web pages typically have a multiple reader, single writer pattern of access. To what extent is concurrency control enforced in the Web environment?
A web document typically has a single owner who installs it in the web service filing system. Normal filing system access control and concurrency control applies. There has been little consideration for cooperative website development until recently. There is no concept of transactions and related pages may be seen in an inconsistent state. Browser front-ends are increasingly being used for access to databases which have more complex access patterns than fling systems. There have been highly public violations of the privacy of bank accounts, for example. In this style of application greater care must be taken over access control and concurrency control than for traditional web documents.
28-9 How is potentially heavy load on web servers managed throughout the web architecture?
Multi-threading at servers, replication of server machines as a cluster, caching of pages at servers, at clients and at various points in between. Mirror sites are also used.
28-10 Outline the purpose of the SOAP protocol.
The motivation is to wrap any service to make it appear like a web service so that it can be accessed by a web browser interface. Client-server interactions need messaging or invocation of some kind and this is supported by using XML for specifying the transmitted data.