|
FOR
DUMMIES
Java an introduction
Java is the most hyped programming language since the days
of C++. I will in this section try to give you a beginners guide to Java.
The Java language is object oriented and easy to to use as a programmer
(once you get the hang of it).
Do not confuse it with the script language JavaScript, whose only resemlbance
with Java is in the name. Netscape took the name Java because of the hype
surounding Java.
What is Java and why the popularity of it?
Well first of all it is platform neutral. It runs on all operating systems
for which there is a Java Virtual Machine (JVM). Today there is support
for NT/95/MacOS/UNIX(all kinds of flavours). Approximatley 20 different
OSes can run Java bytecode using a JVM. When compiling a Java program
(*.java file) you get something called byte code (as opposed to binary
code). The byte code produced can run in what is called a virtual machine
for Java (JVM). JVM translates the bytecode to binary code on the OS the
Java program is running on. This way when you want to port your program
to another OS than your own you only have to write the JVM for that OS
- and this is already done for you. What a great idea!! This is what Javasoft
is calling write once run everywhere.
Another great thing about Java is the simplicity of it compared to other
languages such as C++. When Javasoft developed the language back in the
early 90s they took away everything they didn't find easy in languages
as C++. They of course stole many other ideas from other languages and
put together a language (still evolving) which is much easier for the
programmer. Meanwhile developing the language they published documents
on the Internet, this way they ensured that other peopler coould give
their own suggestions of what should be done. A truly collaborative solution.
Java is object oriented, uses no pointers and has the syntax of C++. This
makes a transition from C++ more easy.
Java and applets
The sucess of Java was in the beginning boosted by all the applets developed
for the web. Small interactive or just graphical embedded programs in
Java pages were attracting people and made them interested in how they
were built.
Today the main interest in Java lies on the server side and how it is
supposed to replace all cgi programs with what is called servlets. In
contrast to cgi programs servlets run in-process which means that when
a call is made to a program on the server it does not have to start a
process. Servlets are also called server side applets.
Another interesting area is CORBA and Java. By building an application
in the form of an applet you can distribute your application through a
web server. Whenever you must fix a bug and redistribute the application
you only have to distribute it once - to the web server. Think of a system
with hundreds of users in different countries - would that be nice or
what.
CORBA stands for Common Object Request Broker Architecture. It is a communication
"protocol" for objects located anywhere in your network (or
on the Internet). You invoke methods on your objects, methods which may
reside on a different server in your LAN. This way you can utilize already
written components effectively. It is really very easy to set up a server
and a client to talk to each other. It is like magic - it just works.
Again try JBuilder Client server edition in which you will get an orb
and idl compilator integrated in the IDE.
Well so far this is we have managed some of the history (by no means all).
If you want a complete run down on it feel free to visit Javasoft.
CORBA
What is CORBA and why do I care?
Common
Object Request Broker Architecture. CORBA is a standard held by a group
called OMG. This standard is supported by some 700 companies and have
been around for at least five years.
CORBA is strong when
you want to build client server applications in heterogenous environments,
e.g. a windows client and a unix server. CORBA is used as a transport
layer letting the client invoke methods on a local proxy of the remote
object. This means that if you have a heavy rendering process e.g. you
should let a fast server do all computing and the client invoke methods
on the server object implementing the rendering process.
ORB.init and object binding
The first thing a client has to do is to initialise the ORB. When this
is done it must bind to a object somehere in the LAN
ORB vendors
JBUILDER
Tips
EXAMPLES
The bank example
A 3 tier applet-server-database example
sfdgsdfg
|