Tanenbaum 3rd edition section 7.6.4: Java
Comer chapter 29 Java Technology for Active Web documents
Recall Web page classification
Active pages more dynamic than "dynamic" web pages.
Internal interaction at client - not dependent on server for interaction
Interaction with server costs
Examples:
The browser requests a Web document in the usual way - HTTP request- URL
The server delivers in the usual way - HTTP response - a document
containing an
executable specification of actions.
Because of the context of the browser's request, the browser chooses to
interpret that document as actions - rather than HTML for display or like
other content types
(even though it is labelled as text/plain)
Example: in HTML an applet tag identifies an active code element.
It can be given parameters when it executes.
It executes in the context of the document that contains the applet invocation, within a window in the browser window.
<h3>Question 2</h3>
For a second chance at the money, tell us the name of the 4th layer in the OSI model.
<applet
codebase="http://cs.anu.edu.au/people/Chris.Johnson"
code="Multichoice2" width=600 height=650>
<param name=answer1 value="Session layer">
<param name=answer2 value="TCP/IP">
<param name=answer3 value="Transport layer">
<param name=answer6 value="Datalink layer">
<param name=answer4 value="Physical layer">
<param name=answer5 value="Heaviside layer">
<param name=correct value="3">
<param name=goodprompt value="Right! the layers are 1:
Physical, 2: Datalink 3: network (and as you said) 4: Transport"
<param name=prompt value="Hint:you should have a mnemonic for
the layer names">
<param name=badprompt value="That turns out to be incorrect. Try again, please.">
</applet>
The function of the applet in this case was designed to display a multichoice question with a button for each answer, reacting to the selection of each with colour changes and response messages (badprompt), until the right answer or a limit on attempts is reached.
Java is a collection of strongly linked technologies from Sun Microsystems
- proprietary system but openly usable
The Java technologies attempt to provide active Web technology
[and apparently the kitchen sink as well]
Three parts to the technology:
including security and network awareness
The language is derived from C++ - a recent 3rd-generation language.
Like many recent languages it is a core language with a set of defined libraries for many of its important functions.
Many C++ features have been eliminated, others tidied up and strengthened.
Not a small language.
Unexpected complexities in definition and implementation - as with all programming languages.
A language acceptor is a mechanism for evaluating a program in that language.
Classical programming language acceptors
distinguish between compilers and interpreters.



The abstract machine code (bytecode)
The Java Virtual Machine -- is the interpreter.
In Java the modules are classes.
The linking of the various classes in a program is lazy
- delayed until needed at execution time
The interpreter
The interpeter provides a PL run time system
and implements a safety policy.
Performance
Size and speed of Java bytecode vs C ( a tiny program!)
|
|
source size |
byte/object code size |
linked executable code size |
execution time |
|
Java |
900 bytes |
489 |
- |
102 seconds |
|
C |
900 bytes |
1420 |
5832 |
15 seconds (0.3 sec optimised) |
Web safety
Portability - platform independence
The Java libraries are mainly in bytecode, some are in native code.
Provide the program interface to services of the interpreter runtime system and other added features
Many of these are essential but not built in to the language.
The library mechanism (through collections of pre-compiled classes) provides a very powerful means of extending the language for whole areas of applications:
has commercial possibilities (re-usable code, packages can be sold as commodity or designed for specific purposes)
... perhaps...
In the language:
In the runtime environment:
Very popular - more for promise than present delivery
Very appropriate for small-medium scale programs - especially applets
- an unknown in large scale programs (and slow speed may tell)
Not easy to program - nothing really is.
Object code is portable.
Provides dynamic documents economically.
Last modified: Tue Mar 30 11:30:02 EST 1999
Queries to :
infs2052@iwaki.anu.edu.au