Next: 4. Implementation
Up: 3. Design Aspects
Previous: 3.2 Communication Architecture
What programming environment should be used to implement this system?
We needed object oriented programming, a suitable support for network
communication and appropriate functionalities to create graphical user
interfaces.
-
C++: C and C++ are one of the most commonly used programming
languages today. That is especially the case for Unix platforms. Since
our system had to run at least be available for Unix and Win32
platforms we would have had to develop two versions -- one for Unix
with X11/Motif support and the other with Visual C++ for Win32
systems.
-
Web based approach: It is easy to create a common platform for
many remote users with this method. HTML pages are usually enhanced
by CGI scripts, Javascripts and Java applets to improve the
interactivity of web pages. A structured way to create bigger systems
is however not recommended with that approach. It is also almost impossible
to use the advantages of object oriented programming. The idea of using
web pages was soon dismissed.
-
Java: Java is an upcoming programming language that is especially
designed to create system independent and network close applications.
It was decided that the project should be developed with Java. We used
Java Development Kid version 1.1.5 to implement all parts of the
project. There were several advantages that suggested the use of
Java:
-
Platform independence: Java can be considered a compiler and
interpreter. The source code is first translated into the so-called
`Java Bytecode' by the Java Compiler. That bytecode is finally
interpreted by a Java Virtual Machine (Java VM). This virtual machine
is available for a broad number of architectures. This makes a Java
program highly platform independent because the bytecode can be
executed on every machine for which a Java VM exists.
-
User interaction: Java is in most cases a better approach for
real-time services compared to a web-server with CGI Scripts. Parts of
the code can be executed on the client's machine. This allows quicker
responses to user requests, since not every single user action has to
be transferred to the server. The problem of the stateless behavior of
web-servers is also not present with Java. Additionally, an operation
that effects only the local user can be executed locally and doesn't
need to burden the server.
-
Object serialization: Java provides object serialization that can
be used to store, reload and transport objects across different
platforms. Those operations are actually streams, which could be files
or further Java processes. An object usually has links to other
objects, which might contain links to further objects and so on.
If an object is exported, then all its referenced companions have to be
stored also. Problems can occur if objects are connected in a circular
path. Object serialization is a method to export objects in a
serialized manner. First, the objects member variables are exported. This
is repeated for all linked objects except for already exported objects.
Object serialization also takes care of the representation of basic
data types. It performs all necessary conversions for different system
architectures. For example conversions between big endian and little
endian.
-
Remote Method Invocation (RMI): RMI is a mechanism comparable to
remote procedure calls in C. It allows the execution of object methods that
are members of remote objects. Remote objects reside on another Java
process, which can run anywhere on the network. For example a client
(which is an object) can call methods of the server and vice versa. The
transport of method arguments (which are objects too) is done by object
serialization.
Of course, there are also disadvantages of Java:
-
Execution speed: The execution speed of Java programs is usually
lower compared to programs developed with compiler languages like C++.
The fact that the bytecode has to be interpreted is the reason for
slower execution. However, there are special compilers available for
some platforms, which translate the bytecode into pure machine code.
These applications are almost as fast as programs designed with usual
compiler languages.
-
Short live time of Java versions: Java is a relatively young
programming language. Sun Microsystems is constantly improving the
language (actually its supporting packages) and its functionality.
The periods between new versions of the language are very short.
JDK version 1.1.5 was the newest version while this project was started.
While working on this project, a number of updates and a completely
revised version (JDK 1.2) was released. Unfortunately, programs written
in different versions of Java are not necessarily executable on the
same virtual machine. This leads to the prediction, that software
written in Java will need to be updated in the near future.
It was decided that the advantages of Java overcome the disadvantages.
Since platform independence was a major goal of our project, it became
clear that other languages could not achieve the desired grade of
platform independence as Java does.
Hopefully, Java will not fall to the same fate as Unix did and lose its
main advantage, the platform independence. This would be the case if
major software companies start to develop and sell their own, not
compatible Java versions. We can hope that developers avoid using
incompatible Java derivatives like Microsoft's Visual J++.
Next: 4. Implementation
Up: 3. Design Aspects
Previous: 3.2 Communication Architecture
Norbert Harrer
1999-11-03