View Single Post
Old Apr 6th, 2008, 7:37 PM   #3
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Re: Java on a large scale...

Your IDE is just a pretty interface to stuff going on behind the scenes.

You enter code. The code gets compiled in to some number of 'class' files. Sometimes, these class files are wrapped neatly in to a 'jar' or 'war' package - just an archive of classes, possibly other stuff too. Your IDE may have a very convenient 'run' button - this translates to compiling the code and then running it. End users do not need your IDE. You simply need to distribute the resulting jar/class/etc. There is an output directory which has these files in it. I have never used blue jay before, but I recall that it is some kind of gimped learning tool. Most any real tool, however, makes it very convenient to wrap your project in to an executable jar. This is exactly the same as a normal jar, but with the additional requirement that one of the class files is the startup class and that class file contains a suitable 'man' function. In most configurations, an executable jar can be run by double clicking.

'Web' java works the same way as standalone java. The difference is how things are started and what you then do.
If you have written a java applet before, recall how they are structured. There is an 'applet' base class which defines certain methods which you may want to override, such as repainting. There is no need for a 'main' function, certainly not a static main function. Rather than calling a 'static' (not associated with an object) method as main is, the program hosting the applet will create an instance of your specialized applet class. It's just "an applet." The program knows that it contains "applet" methods. It can be treated like any other object - it just happened to have been loaded on demand.
"Servlets" (think 'server') operate the same way. There is some particular class that the 'servlet container' expects to deal with. The container will load your specialized servlets, which will respond to web requests just as your applet may respond to drawing events.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote