August 17, 2004
Java Newsletter - August 2004Al Williams
Keeping up with the latest in Java development tools and APIs is a full time job these days. Luckily, Dr. Dobb's Java Newsletter is here to do the work for you. Edited by Java expert Al Williams, Dr. Dobb's Java Newsletter covers all the Java news that's fit to print, including API revisions and releases, commercial and open-source development tools, Java tech tips, and more.
Issue #14 By Al Williams
You probably know that I live in South Texas, and the summer is in full swing here. As Im writing this, I can see the top globe of my Galileo thermometer sinking lazily to the bottom where the other bubbles are already huddled (I really should close my blinds in the afternoon). Any very hot (or very cold) day reminds me that it is the opposite season in the southern hemisphere. My friends in Australia sun on the beach at Christmas and are having cool spells in the middle of our summer here in Texas. This is sort of a meteorological yin/yang. Perhaps it is a sort of conservation of weather. After all, momentum, energy, and mass are all conserved. Ive often thought that luck is probably conserved too (good fortune usually seems to be at someone elses expense). So why shouldnt weather be conserved as well? I think several quantities in software development are also conserved. Everyone knows you can write code that is small or code that is fast, but you usually cant do both at the same time. Total time spent in meetings seems to be inversely proportional with quantity of code produced. Thinking about duality is often an interesting way to get some perspective on something familiar. What are the dual parts of Java? Most people would agree that Java programmers enjoy portability, code security, and an extensive library (Im always particularly impressed with the librarys networking abilities). So what is conserved? There are a few downsides to Java. Safe code means less flexibility with techniques like pointers. Many people call this a good thing (just as I think a warm New Years day would be pleasant). The JVM itself is also a cost inherent in Javas features. After all, the JVM provides portability and security, but it also hides important details about memory allocation and other system utilization. Besides, the JVM is often a performance bottleneck. Thats not to say that the benefits dont outweigh the problems. Besides, just as it is warm in the north while it is cold in the south, other languages have other strengths and weaknesses. C is versatile, but it isnt as portable and certainly not as safe. It also doesnt enjoy the standard library support that is one of Javas strongest points. Perl, Visual Basic, and Fortran all have various strengths and weaknesses. With so much emphasis lately on the future of Java standards (especially the move to open source Java), it pays to stand back and look at where we would like Java to go in the future. No matter how much you love Java (or whatever your pet language is), I have little doubt that there is room for improvement. A different perspective is often useful to determine future directions for growth. My fear? Endless squabbling over Javas feature set will allow someone else to provide the tools developers need. Unix vendors squabbled over the operating system market and provided Microsoft with an opportunity to gain vital footholds. If C standards had addressed portability, networking, and code safety, Java may have found fewer developers ready to switch. So my question to you is where do you want Java to go? Do we need simpler development tools? Do we want more ability to manipulate native environments at the expense of portability? How important is JVM speed? Drop me a line with your thoughts.
Speaking of Native Environments
And Speaking of Windows
Javas Red Hat The software is based on JOnAS (Java Open Application Server), an open source application server developed by ObjectWeb. It also incorporates the Apache Tomcat Java servlet engine and Struts. Meanwhile, the Geronimo project (Apaches Java Application Server) announced it will miss its August 6th target for a certified release, but expect to complete certification later in the quarter.
Beehive
The Business View The article mentions that McNealys management team (including Edward Zander and Bill Joy) recommended cost cutting measures, but were overruled. The editorial ends by calling McNealys turnaround of Sun a longshot.
Tech Talk: Compiling On the Fly Just be sure that tools.jar is in your CLASSPATH, and you can actually instantiate the Java compiler and execute it. For example, suppose you want to allow a user to write a mathematical equation and evaluate it. Heres a users session with the proposed program:
$ java onfly
// Compile an equation on the fly
import java.io.*;
class onfly
{
// This actually compiles our class
// Note that we have to have a "dummy" class for
// our initial compile
public static int compileeqn()
{
com.sun.tools.javac.Main javac = new com.sun.tools.javac.Main();
String [] args= new String []
{
"-d",
System.getProperty("user.dir"),
"-nowarn",
"onflyeqn.java"
};
return javac.compile(args);
}
// Call the compiled class
public static void action(double x) throws Exception
{
onflyeqn eqn=new onflyeqn(); // create class we compiled
System.out.println("Result is " + eqn.f(x));
}
// Ask the user for f(x) and x
public static void main(String [] args) throws Exception
{
String eqn;
double x;
FileWriter fw=new FileWriter("onflyeqn.java");
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter equation: ");
eqn=br.readLine();
// Write onflyeqn.java
fw.write("class onflyeqn {\n");
fw.write("public static double f(double x) throws Exception {\n");
fw.write(" return ");
fw.write(eqn);
fw.write(";\n }\n}");
fw.close();
// Compile the code
compileeqn();
// could check return code here!
// Read X (reuse eqn since we don't need it anymore)
System.out.println("Enter X: ");
eqn=br.readLine();
x=Float.parseFloat(eqn);
// Run the code
action(x);
}
}
The code reads an equation and builds the file class onflyeqn {
public static double f(double x) throws Exception {
return Math.cos(x*x)+10;
}
}
You actually need a dummy version of onflyeqn to satisfy the compiler that the class exists when you first compile your code. The compilers Main method takes the usual command line argument array, so you already know how to invoke the compiler. Once the compiler completes (you get an error return code so you can tell if the compile worked or not) you can call the new object in the usual way.
JBoss Server Passes J2EE Compatibility Tests JBoss announced that it is the first company to support a fully J2EE-compatible application server. The professional open-source firm plans to announce that the JBoss Java application server passed all of the tests that make up the J2EE Compatibility Test Suite from Sun Microsystems. In a press statement, executives from JBoss, based in Atlanta, stated the company also will release an early version of JBoss 4.0 Java application server, which is J2EE compatible, with a final release to follow later this year. "Enterprise customers now have a J2EE-compatible open-source alternative backed up with superior services from JBoss Inc. to deliver the highest level of quality and reliability for achieving their business objectives," JBoss CEO Marc Fleury said in a press statement. The news comes as little surprise. At JavaOne in late June, Fleury told CRN that testing of the application server was almost complete. Still, the presence of fully certified J2EE open-source software in the market could prove troublesome for proprietary J2EE software vendors such as BEA Systems and IBM, especially since Sun Microsystems also is pondering whether to open-source some of its own Java software (see story). Through Project Geronimo, the Apache Software Group also is readying a fully J2EE-certified, open-source application for release in August. The JBoss application server already has increased market pressure on proprietary Java software vendors, and analysts believe this likely will continue as customers consider open-source alternatives to traditional proprietary software. "Frankly, the entire industry is moving toward this," said James Governor, principal analyst with London-based think tank Red Monk. "Everyone is going to be buying a combination of open-source and proprietary software." In addition to the JBoss application server, JBoss also supports an open-source portal, and has future plans to release, either through in-house development or through acquisition, open-source business process management (BPM) and workflow software, Fleury said at JavaOne. One likely candidate for acquisition is BPM software provider Oak Grove Systems. Oak Grove and JBoss have been quietly forging stronger ties lately, and at JavaOne Fleury hinted to CRN that JBoss may purchase Oak Grove. However, no deal has been reached. [Source: CRN]
Coming Up in DDJ - The Eclipse Visual Editor for Java: The Eclipse Visual Editor for Java is a plug-in for, well, visual editing. - Refactoring with Eclipse: Eclipse provides a collection of refactoring features. - Eclipse 3.0's Rich Client Platform: Eclipse 3.0's Rich Client Platform takes the drudgery out of writing SWT-based applications.
In Closing
|
|
||||||||||||||||||||||||||||
|
|
|
|