Unit 9 Flashcards
SAQ 1 - A
Comparing how parameter data associated with HTTP GET requests and POST requests is sent and received, answer the following question.
What are the main similarities between GET and POST?
Parameter data is extracted by servlet code or JSP directives in exactly the same way, regardless of whether it is associated with a POST or a GET request. The underlying differences are hidden by the standard Java method calls or JSP directives. For both types of request, parameter data is normally sent in URL-encoded form, which means that any unsafe characters are replaced by their percent-encoded hexadecimal ASCII code values.
SAQ 1 - B
Comparing how parameter data associated with HTTP GET requests and POST requests is sent and received, answer the following question.
What are the main differences between GET and POST?
GET requests append the parameter names and their values to the URL in the GET command line itself. POST requests send the parameter data in the body of the request, following the lines containing the POST command and any lines of header data. This means that parameters associated with a POST command are less visible to users. This can also accommodate much more parameter data, since the maximum length of the extended URL used by GET requests is limited on most systems. POST can also deal with more complex data such as files or binary data, whereas GET request data is much more limited in type
SAQ 2
What are the main issues to bear in mind when comparing thin clients, applet clients and application clients in Java EE?
Thin clients, typically browsers, may have limited functionality and operate mainly in pull mode, although these can be improved to some extent by the use of scripting languages such as JavaScript. They require only very limited hardware and software resources on the client machine.
Applets and application clients can provide a richer user interface and take some of the processing load away from the server for a more responsive client. They normally require more processing and storage on the client machine than thin clients.
Thin clients and applet-based clients have minimal deployment issues, assuming that most clients have a standard browser, though sometimes issues of browser versions and compatibility may arise. Compatibility issues are of more concern for applet-based clients since browsers vary in their treatment of applets, although this is often solved by using the Java Plug-in.
For application clients, there has to be a way of installing the client software on each client machine and keeping this up to date – this can be problematic, but some Java EE implementations allow deployment of the application client software on the server for automatic downloading to clients as required.
SAQ 3 - A
What are the advantages and disadvantages of Client polling
Client polling (using the refresh META tag) is simple and works on all browsers. Its disadvantage is that it can generate considerable web traffic by frequent reloading of web pages. It also requires opening and closing connections to the server for every request, and many of the reloads may be unnecessary.
SAQ 3 - B
What are the advantages and disadvantages of RSS?
RSS feeds eliminate the problem of unnecessarily downloading whole web pages even if nothing on that page has changed – the page is download only if something has changed since the last time it was checked. However, repeated polling of the server is required by the RSS reader, so the overhead of repeated connection opening and closing is similar to the case of client polling.
SAQ 3 - C
What are the advantages and disadvantages of The server push approach using multipart/x-mixed-replace?
The server push approach using multipart/x-mixed-replace puts the server in control of when the web page is reloaded. Hence page reloads should happen only when there is something new to download. Because the server keeps the HTTP connection with the client open while downloading a series of parts, it avoids the overhead of repeated opening and closing of HTTP connections. However, keeping the HTTP connection open may be a problem if there are many clients using this approach as most servers limit the number of possible HTTP connections. This approach is not supported by some browsers.
SAQ 4 - A
What are the pros and cons of the following push technologies for applets and application clients?
A- UDP
UDP is connectionless and therefore each message is relatively efficient. However, it is unreliable in that messages can be lost or corrupted. It also has the disadvantage for large-scale systems that it requires the server to store IP addresses of all registered clients and to send one message per registered client for each notification.
SAQ 4 - B
What are the pros and cons of the following push technologies for applets and application clients?
B - Multicast UDP
Multicast UDP has the same pros and cons as normal (unicast) UDP, but is more efficient when the sender has to communicate the same message to many receivers. A disadvantage is that not all routers support multicast UDP.
SAQ 4 - C
What are the pros and cons of the following push technologies for applets and application clients?
C - TCP
TCP is a reliable connection-oriented protocol in that lost, corrupt or out-of-order data packets will be restored automatically by the TCP protocol software. Its disadvantage is relative inefficiency – setting up connections takes significant time and effort, and means that it is not suited to multicasting.
SAQ 4 - D
What are the pros and cons of the following push technologies for applets and application clients?
D - Messaging services
Messaging services are the most general approach. They use asynchronous communication, which can aid responsiveness, combined with reliability. The publish/subscribe approach is well suited to implementing server push. However, the middleware may introduce a significant performance overhead in some cases, and most middleware is proprietary rather than standard.
SAQ 5
In distributed systems, what is the difference between physically synchronised clocks and logical clocks?
Physically synchronised clocks on different hosts will hold time values that are the same to within some specified tolerance. If they are externally synchronised, this common time will be synchronised to some standard time such as UTC. If they are internally synchronised, then the common time may differ significantly from standard time, but in some applications only internal synchronisation is essential. Logical clocks can be used in some situations where synchronisation is not required. Each host maintains a clock which it updates immediately after an event, such as sending or receiving a message. Messages sent to other hosts are time-stamped with the logical time of the sender. Receivers update their local logical clocks, if necessary, to ensure that events always have a later logical time than the event that caused them. Thus logical clocks can be used to record an order of events, although they are not applicable when the actual standard time is needed, such as in many real-time systems.
Exercise 1 - A
What requirements do you think a push technology approach might have?
Since the server is to send out data without an explicit client request, there must be a way for the server to ascertain to which clients the data should be sent. One way to do this is for each client to send an initial message to the server to register their interest in receiving regular information updates from the server. It could be quite resource intensive if the server has to send out the same update many times to all its registered clients – so it would be good if there was a way to send the update message only once but have all interested clients receive it. You may have thought of some different or additional requirements.
Exercise 1 - B
Can you think of any push technology approaches currently in use on the Web?
The RSS (Really Simple Syndication) system, now available on many websites, arguably works in a push technology way. This allows you to sign up to receive occasional updates from a website whenever something important has changed or occurred. This avoids users having to frequently check a site to see if anything has happened. Only those clients who have registered for a given RSS service will receive the updates. However, there is some dispute about whether this is a pure push technology because to receive updates it is necessary to run an RSS reader program that polls the relevant website regularly while it is running. You might have thought of a different example – does it meet your requirements or our requirements from part (a)?
Exercise 2
Why do you think there is no such thing as multicast TCP, while there is multicast UDP?
In multicast UDP the server does not know anything about the clients in the multicast group it is sending to. It knows only the special IP address for the multicast group. This is acceptable in UDP because there is no need to set up a connection between server and client(s). In TCP, both the client and the server must know each other’s IP addresses in order to set up a connection. This would negate one of the advantages of multicast over unicast – the multicast server does not need to keep a list of registered clients.
Exercise 3 - a
Can you think of situations or applications where the following types of clock synchronisation would be appropriate in distributed systems?
(a) External synchronisation
This is essential where the time used by hosts is required to be correct in relation to standard time such as UTC. This would include applications that must carry out an activity at a specific actual time, such as the finishing time of an internet auction.