Sunday, June 25, 2006

 

J2SE 5.0 Name and Version Change

I love Sun's Java language.

I love the fact that they have found a way to bring it to me for free. Well, except for all those books I bought from them in the past decade and the odd CD-ROM and IDE I bought from them in the 1990s, that is.

I love the fact that Sun has contributed so much to the world of computing.

That means not just by creating Java - but writing many RFCs, a file-sharing mechanism, a procedure call mechanism, and steadily improving Unix.

What I really do not love is Sun's versioning scheme. The problem is simple.

When most people or organizations change a version number, they simply do it by incrementing a digit.

If that digit was 9, it might go back down to zero and the next digit would go up. Composite version numbers work pretty much the same way, except you can force a cary to the next version subfield up and of course reset the ones to the right of it back to zero.

Simple.

Unless you are Sun.

Then there is some weird side-effect.

Kind of like a DNA transcription error, there are mutations that occur. Sun's version number transcription RNA must be damaged.

Instead of merely incrementing the number when a new version comes out - they change the version naming scheme. The way you refer to Java every other version changes.

Worse, Sun has got a bicameral brain when it comes to versioning.

The human brain has two hemispheres - the left that is obsessed with counting, logic, and the odd joke - and the right that is obsessed with something called "the big picture" as well as context, balance, and what is really important.

Sun is a lot like that. They have the engineering half of the company, which simply starts at a number and counts upward. They have the marketing half of the company - apparently feels the need to increment words, phrases, syntax, grammar.

Do not ask me how they do the latter - I know not. I am only a simple programmer, trying to make since of The Big Picture, but alas the only tools I have are Logic & Math. These two things are completely inadequate for grasping the wondrous way's of Sun Marketing's Incredible Counting Machine.

J2SE 5.0 Name and Version Change:


The upcoming feature release of J2SE is version 5.0. We have changed the version of this release from 1.5.0 to 5.0 to better reflect the level of maturity, stability, scalability and security built into J2SE. (This release is also known as "Tiger".)

Where Is Version 1.5.0 Still Used?

J2SE also keeps the version number 1.5.0 (or 1.5) in some under-the-cover
places that are visible only to developers, where the version number
is parsed by programs. In these cases, 1.5.0 refers to exactly the same
platform and products numbered 5.0. Version numbers 1.5.0 and 1.5 are used at:

java -version => (among other info, returns: java version "1.5.0")
java -fullversion => (returns: java full version "1.5.0-b64")
javac -source 1.5 => ( javac -source 5 also works)
java.version => system property
java.vm.version => system property
@since 1.5 => tag values
jdk1.5.0 => installation directory
jre1.5.0 => installation directory
http://java.sun.com/j2se/1.5.0 => website (http://java.sun.com/j2se/5.0also works)


Basically, what this means in English is: We have changed the numbering scheme for our versioning system once again, god help us all. What was once Java 1.1 became Java 2 at the time of the Great Conjunction, when our numbering systems became divided. When 1.2 was followed by 1.3, in name, it remained Java 2 and did not budge. Likewise when 1.4 came, its name still did not yield any change. However, when 1.5 came forth, the name suddenly became Java 5.

And now that we know by the power of The Quickening, that 1.6 shall soon be here - we shall change the form of the name again, to sew further confusion in our enemies and strengthen our customary allies.


In order to truly understand Sun's Java versioning/naming scheme - and believe me, I wish I was kidding but I am not - you must watch the movie named The Dark Crystal.

In that movie there was one race (think of them as Sun employees). One thousand years before the first act in the movie occurs, that one race cracked Crystal of Truth - which then became The Dark Crystal.

When happened next was strange: two races appeared. One was a race of wizards, the was - well, different. Let us just say they were strong, or at least powerful.

The two races had different powers, different ways of interacting with the world, and very different values.

One day a a boy named Jen that was of neither race found the missing shard that had been lost since the crystal broke.

He placed the missing shard back into the crystal, which once again became the Crystal of Truth. The two races merge back into one. They move on to a new plane of existence, and the world is healed as good as new.

That is how cool it would be if there was only one numbering system for Java, one numbering system for Solaris.

It is not required that technical people and marketing people have the same way of talking.

But it would be pretty wonderful if they counted the same way.

Even when the tower of Babel fell, people did not lose the ability to count the same way.

People can get past having/using different languages. What they cannot get past, is having different was of counting the same thing.

Technorati tags: , ,

Saturday, June 24, 2006

 

Installing JBoss Eclipse IDE onto Eclipse running on Mac, Linux, or MS-Windows

Did you take a hasty look at the JBoss IDE download page, notice there were no builds provided for the Macintosh, and assume JBoss IDE would not run on the Mac?

Well, assume no such thing!

You probably already have the latest version of the Eclipse IDE (3.1.2). So you can just use the update URL defined in the document cited below.

JBoss Eclipse IDE 1.5 Installation Guide:
JBoss Eclipse IDE 1.5 Installation


Ten or twenty minutes later - depending on the speed of your connection and your CPU & disk drive - you will be up-and-running with a fully JBoss-aware version of the Eclipse IDE.

Though at the moment, the documentation above says it is written for JBoss Eclipse IDE 1.5 - the version you will get is Eclipse IDE 1.6. Fear not, this is a good thing!

Here is what you will get, the document explains:


Pretty good, huh?!!

What is really exciting is that not only do you get support for J2EE 1.4 - you also get support for EJB 3.0!

Not only are you getting support for creating EJBs and stuff like that, as you would expect - you are also getting support for creating web pages!

Well, that is part of J2EE - at least JSP is. But JBoss IDE does not stop with supporting creating JSP pages. They let you create/edit pure HTML pages, CSS files, and Javascript.

They even provide support for shortcuts for common little HTML constructs.

Similar attention has been paid to make it easier to annotate your Java files with XDoclet tags.

You really get a lot with this free IDE. And, yes - it runs on the Mac!

Thursday, June 22, 2006

 

Generally Java: Concurrent Programming with J2SE 5.0 (Quartz in servers)

In a recent post, Generally Java: Concurrent Programming with J2SE 5.0, I noted the general ban on concurrent programming in Java web and application servers.

Fortunately, O'Reilly published an article back in March of this year about the Quartz scheduler.

Their article, Scheduling Jobs in a Java Web Application shows how to set up the Quartz scheduler as a Struts plugin.

This allows the scheduler to be initialized when the web application starts.

The article says it works with Tomcat and should work with other Java web containers as well.

Using the Quartz scheduler might alleviate the temptation to throw thread-related concurrent programming into a webapp or EJB.

If a scheduler is not what is needed, other techniques will have to be used to address concurrency needs of servlets or EJBs. If it is though, that is one less headache for developers to have to worry about themselves.

Wednesday, June 21, 2006

 

Concurrent Programming with J2SE 5.0

JDK 1.5 makes doing concurrent programming - working with threads and such - a lot easier.

Java has long supported the most primitive features needed to support concurrency.

The Thread class has been around forever. So have the monitors that are controlled with the synchronized statement and method declaration attribute, and the primitives defined right on the Object class (meaning all classes, courtesy of inheritance): wait(), notify(), notifyAll().

In JDK 1.5, Sun added a lot more to their standard Java class library.

The new features give you the finished building blocks to solve problems. Instead of you having to build them yourself from the ground up, they do that for you now.
Concurrent Programming with J2SE 5.0:
The Java 2 Platform, Standard Edition release 5.0 (J2SE 5.0), which is also known as Tiger, has provided a new path to multithreading in the Java programming language. The original mechanisms for coordinating threads with wait() and notify() are now enhanced with new and sophisticated mechanisms for working with threads. The new mechanisms are part of the java.util.concurrent package, which aims to offer a standard set of concurrency utilities that will ease the task of developing multithreaded applications and servers. In addition, such standards will improve the quality of such applications.

Of course you are still highly restricted on when you can use threads. The standard EJB and web containers that are written in Java do not like you to do that. If they allowed it, then resource management and clustering would be considerably more difficult and inefficient, if it was even possible at all.

Ah, there is the rub.
Technorati tags: , ,

 

How Google converted to Java SE 5

Google updated its software to use the features of JDK 1.5 from the older JDK 1.4 Java some time ago.

One of their software engineers, Li Moore, talked with Sun about that last year.

The results are interesting. For one thing, Google uses Java for a lot of stuff. Unlike Python (which has a .py suffix for its filenames), they do not really expose that fact on their website.

The one notable exception I can think of offhand is that Blogger.com appears to use Struts (a Java framework) for some of its web pages. The way you can tell is the .do at the end of a filename in a URI. That is what Struts applications use, by convention, for their filename suffix.

The other interesting thing is that Google does not have a diffident approach to using the language features at all. They use enums, concurrency (work queues, thread pools, etc.), the new iterating capability of the for statement, NIO, and servlets.

Looks like they are pretty invested in Java!

Anyway, they took a phased approach that sounds pretty familiar.

Right at the beginning of the decade, I had to carry out the migration of a huge Java application comprised of about 1,500 classes.

I did it. And you had better believe I did it in a series of steps.

My migration went a bit farther than Google's. Mine consisted of converting those 1,500 classes from Microsoft's JDK 1.1 JVM - to Sun's JDK 1.3 JVM.

You better believe I was not going to throw all the classes up in the air at once, changing them in mid-flight, and see what still under the new interpreter!

I think that was the biggest number of classes I had sole responsibility for changing in my whole OOP life. A good strategy, and some hypotheses/experiments done up front, really saves your butt when you are dong one of these conversions.
Sun Microsystems Talks With Li Moore of Google:
Li Moore, software engineer at Google, Inc., about his company's switch from J2SE version 1.4 to 5.0.
Technorati tags: , , ,

 

XML Validation and XPath Evaluation in J2SE 5.0

Java SE 5 has made it possible to use XPath expressions to pull out pieces of an XML document - without using any third-party software. Nothing is required to do it beyond JDK 1.5 and a knowledge of XPath expressions, which are a well-documented standard.

Another thing they have added in is a new Validator object for validating XML documents - and a Schema object that encapsulates a schema.

SchemaFactory class has a static method newInstance to identify what kind of SchemaFactory to produce. W3 Schema will always work.

It appears the intention is to let you specify other things too in the future. There have been a lot easier/more-powerful Schema standards out for almost half a decade.

XML Validation and XPath Evaluation in J2SE 5.0:
Some of the exciting new features of the Java 2 Platform, Standard Edition (J2SE) 5.0 release, code-named Tiger, are the added XML validation package at javax.xml.validation and the XPath libraries at javax.xml.xpath. Before the Tiger release, the Java API for XML Processing (JAXP) SAXParser or DocumentBuilder classes were the primary instruments of Java technology XML validation. The new Validation API, however, decouples the validation of an XML document from the parsing of the document. Among other things, this allows Java technology to support multiple schema languages. Let's take a closer look at XML validation first.

Glad to see the XML support in Java has improved a lot with JDK 1.5.

Technorati tags: , , , ,

 

Using JConsole to Monitor Applications

Java SE 5 (JDK 1.5) includes a powerful facility for monitoring Java applications and servers.

The GUI application that is the front-end for this facility is JConsole. Using the JMX Remote API, it can tap into applications running in other processes - even other computers - and display graphically or using tables exactly what is going on.

Using the JMX API, an application can declare MBeans. In addition, starting with Java SE 5, the JVM itself comes with a number of useful MBeans. These particular beans cut right into the JVM, giving you a view into its major moving parts:


That is enough to tell at a glance what is going on as far as the most common points of failure. Also, the more mysterious ones.

Using JConsole to Monitor Applications:
The Java 2 Platform, Standard Edition (J2SE) 5.0 release provides comprehensive monitoring and management support. It not only defines the management interfaces for the Java virtual machine, but also provides out-of-the-box remote monitoring and management on the Java platform and of applications that run on it. In addition, JDK 5.0 includes the Java Monitoring and Management Console (JConsole) tool. It uses the extensive instrumentation of the Java virtual machine to provide information on performance and resource consumption of applications running on the Java platform using Java Management
Extension (JMX) technology.


The article is fantastic. It is richly illustrated with numerous screenshots to concretely demonstrate what it is saying. It includes pithy little program listings interspersed throughout the text. And when they author mentions a class - he gives its full name - including the package - so you can go look it up.

Technorati tags: , , , ,

 

Tapestry moves to top-level Apache project!

Kind of a landmark day for Tapestry programmers today.

Apache News Online: 21 June 2006 - Apache Tapestry moved up to Top Level:
Apache Tapestry has moved to a TLP (Top Level Project) at its new address, http://tapestry.apache.org/.


What this means is that Apache gets its own hostname.

It will also get a heck of a lot easier/faster to get to its home page now.


 

Using Annotations to add Validity Constraints to JavaBeans Properties

I often - and I mean really, really often - find myself having to verify this piece of data or that appears to be acceptable to the application I am writing or maintaining.

There is sort of a 3-way tug-of-war between reusability of the validation rules, precision of the diagnostic messages when data is rejected, and the ease-of-expressing what these constraints are in the program.

Ideally, I like something that is a blend of code and data to do it.

Table-driven schemes are kind of passe. They do not really express all that much and when special cases arise, as they inevitably do, flags start popping up like dandelions in May. Next thing you know, they are everywhere - and you have a mess to clean up.

Objects are good, assuming you are using an OOP program. However, while dynamically constructing the is useful - the program can wind up not exactly sapient about why this thing or that thing is good or bad. And since that is the point of writing data-input checking logic in the first place - that is not so good either.

Java SE 5 Annotations look like a good mechanism to do this with. They go into the code, they store metadata. So know you, as a programmer, have a way to express what is acceptable/unnacceptable, why it is acceptable/unnacceptable, and (if you are clever) - how to make it acceptable. You can reuse that information in different ways, in different places.

That in and of itself is no big deal. You can still do that, with varying degrees of elegance (also known as maintainability) using the other techniques.

What is different is that annotations as visible to the Javadoc compiler, to IDEs, a person reading the source code, QA/test software, and the programs themselves. They all 5 get their information from one source, ultimately.

That tends to be a useful distinction. One that I find really attractive.

Using Annotations to add Validity Constraints to JavaBeans Properties:
Currently there is no standard way to add validity constraints to Java classes. This is in contrast to other languages like XML in which (using XML Schema) relatively rich constraints may be specified. With the advent of annotations (JSR 175) in the Java 2 Platform, Standard Edition (J2SE) 5.0 a convenient mechanism now exists to allow such constraints to be specified in the Java meta model. This article explores how annotations might be used for this purpose and discusses why this may be an important capability.
[By the way, Java SE 7 adds a facility called Descriptors. Descriptors add this capability to specify validity constraints on the attributes and operations of MBeans.]

This article is a very nice tutorial with some extremely well-written examples. It shows just how you can validate data in an elegant way with Java SE 5.

If that makes for code that is faster to write, easier to maintain, and quickly explained to other staff/manager and users - then I am all for it.

Technorati tags: , , ,

 

Java Rock Star: Eamonn McManus

Sun is touting its top technical leads once again.

Looks like this year their buzzwords for JavaOne include: JMX, MBeans, MXBeans, AJAX, AOP, and Javascript.

The Descriptors feature they are adding in Java SE 7 sound pretty neat. They add the ability to specify some pretty interesting metadata for an MBean about attributes and operations: namely what values (not merely types) are valid, and even the units associated with the values.

Java Rock Star: Eamonn McManus:
Snapshot: Eamonn McManus is the spec lead of the Java Management Extensions (JMX) team at Sun Microsystems. As such, he heads the technical work on JSR 255 (JMX API 2.0) and JSR 262 (Web Services Connector for JMX Agents).

 

Java Platform, Standard Edition (Java SE) 6 Beta 2 is out

JDK 1.6 (Java SE 6) beat 2 is out already!

They have added some improvements in both the debugging capabilities and the JMX (monitoring/management) API.

Java Platform, Standard Edition (Java SE) 6 Beta:

Improved JMX Monitoring API
New custom deployment facilities
Improved memory usage analysis and leak detection
Improvements to the Java Platform Debug Architecture (JPDA) & JVM Tool Interface


This will be a big boon to developers.

Better transparency into applications and services really makes a difference when something is going wrong but nobody can quite put their finger on it. This is especially true of performance problems.

Being able to put numbers on throughput, latencies, and so forth - that sweeps the fog away from the scene.

The improvements in debugging sound neat too - at least down the road. Until they actually get taken advantage of in an IDE, it might not matter. However, at least debuggers will be getting better in the future.

 

Integration Developers News

A quick uptake of Geronimo as a J2EE 1.4 server would be very interesting. That is especially true because JBoss 4.0 is really flourishing now as well.

According to the article below, both IBM and BEA have announced their support for Geronimo. The article also states that Liferay, the Java portal software group, is bringing their technology to Geronimo.

Integration Developers News: "The Apache Geronimo project for Open Source enterprise J2EE, while still in its 1.x release, is quickly becoming part of the J2EE mainstream. Since IBM’s early adoption of Geronimo as a core component of a Websphere J2EE app server for mid-sized companies, other ISVs, partners and end users are all showing healthy interest. "

Tuesday, June 20, 2006

 

Java things on the All Consuming Web 2.0, AJAX, social website

I have started tagging books about Java I have read and/or own over at All Consuming this evening.

If you trust people tagging things java on All Consuming:
Items tagged java


Some of the books are reviewed on the site, which is actually a pretty cool website in its own right.

It is a full-blown, Web 2.0, AJAX-enabled, social software website. How is that for being buzzword compliant?

Anyway, you will find lots of books, movies, food/drink, and music on the site.

Many of the book items on All Consuming have a hyperlink to Amazon. Mostly I use that for reference, to get more details. You can order it you want, of course - but you certainly do not have to buy it.

The nice thing about this site is you can catalog your readings as you do them - and share that with peers in realtime. It helps if you write reviews or at least comment on the books you are reading. Your name and pic still appear next to it, even if you are just consuming or have consumed it.

So either way, people will start to discover you might be a bit of a savant on particular subjects. You, in turn, might meet some other people who share your love for a particular kind of book, music, or whatever.

If you are a Java programmer, there are a couple good reasons to visit the site right there.

One reason is not that the site is programmed in Java - because it is not. The whole site is written in Ruby, using that Ruby on Rails framework you have no doubt heard of.

Ah, but there is a third reason to visit the site. You can see that cool AJAX user interface you have been reading about in use on the site. In fact, you can use it.

The site is free. And AJAX is AJAX. So you will get some useful experience out of just visiting the site, signing up, and using it for a while to record some stuff you consume.

Technorati tags: , , ,

Sunday, June 18, 2006

 

created but unpopulated, and hat-tip to JBoss Seam

Just threw this blog up here so I would have someplace to post information about my Java related creations.

Right now, there is nothing of sufficient impact to merit such posts.

In a little while, I hope to have some nice software to talk about and some handy Java tutorials which I can point out.


What have I been up to Java-wise?

This past week I did little coding and a lot of studying - with the help of Java in a Nutshell, 5th edition - of the features introduced in JDK 1.5 (J5SE). They have been out for two years, so I would not exactly call them new.

However, lots of shops and many programmers are kind of conservative. So, while I would guess JDK 1.5 (J5SE) has a lot of traction by now, it may not have had it for anywhere near that whole two years.

I am also going back to read Professional Java JDK 5 Edition. It is a lot more prosaic than the Nutshell book. It has a lot of diagrams. Nutshell mostly just diagrams class/interface inheritence.


One thing that will certainly be helping it get a ton of traction is JBoss Seam.

JBoss Seam is a Java web/database application framework that harnesses the power of J5SE annotations, EJB 3.0 object persistence, and the JCP-approved JSR-168 Portlets.

In addition, Seam features support for AJAX programming, making it possible to create much more compelling web-based application user interfaces than ever before.

For more information, see this article, JBoss Seam knits AJAX and Java together. Or just go right to the Seam home page.


By the way, in case you have not read the Java industry news in the past few months, Red Hat bought JBoss and the sale was recently completed.

This page is powered by Blogger. Isn't yours?