<< August 2003 | Home | October 2003 >>

JOnAS, TWiki, Qexo, ...

I installed three software systems today. And I had three experiences.

First comes JOnAS. I promised I'll look into this Open Source J2EE 1.3 application server fifteen days ago.

So far my impression of JOnAS 3.2 has been positive:

  • It comes with top quality documentation that prints out to 203 pages.
  • The installation process is sensible and easy to fathom.
  • The documentation matches the product. (You can't imagine how much I appreciated this.)
  • All the samples compile and run as expected. (Except for the entity bean example that requires JDBC, which I haven't set up yet.)
  • The admin console looks really nice.

Compared to JBoss 3.2.1, which runs this site, I would only miss stub-less deployment and hot-redeployment. This was made up by the nice startup/shutdown and admin scripts.


Then comes TWiki. Eric Burke thinks it is the way to go for online software project related documentation.

It too comes with voluminous documentation. (And if you know me, you know I'm going to print it out. It prints out to 144 pages.) However, the documentation misses the mark in many ways. Sometimes it's too specific ("create a directory c:/twiki"). Sometimes it's too vague ("use mod_ntlm for IE users"). But at the end, I had it running on a Windows 2000 Server with Apache HTTP Server 1.3.22 and cygwin. Not a trivial feat.

I have to install a few pieces of Perl functionality through CPAN. And I have to admit that CPAN is reusable components done right. Now if only us Java people could have something like CPAN.


Finally a few words for Qexo, the GNU Kawa implementation of XQuery. The kawa-1.7.jar (1.3MB) packs incredible power!

Imagine JSP pages that aren't translated to Java source files, written to the file system, and then compiled to class files, and finally loaded into the servlet container. The Kawa Pages are compiled with the Kawa compiler in memory and then directly loaded into the JVM.

It could only mean---speed!

Consulting, Customers, Foolishness, ...

"Do you do what the customer wants" is often a hot topic among consultants. I've found a good quote by Norman Walsh, embedded in this article:

Consulting taught me that customers sometimes want damned foolish things. And I know that sometimes you have to do what the customer wants. But experience suggests that when you let the customer convince you to do something damned foolish, later on you have to explain to the customer, when their experience convinces them it's damned foolish, why they paid you good money to do something so damned foolish. "Because you told me to" is only sometimes an effective explanation.

RELAX NG, jing, trang, ...

Once in a while, a piece of software grabs your attention, and you are irreversibly hooked. And you want to explore it more.

Learning nXML, which is fun in itself, leads me to a sequence of websites, documents, and technologies. Ones you don't hear mentioned in the press.

First, nXML uses RELAX NG Compact Syntax for validation. It looked like this:

element addressBook {
  element card {
    element name { text },
    element email { text }
  }*
}

Then there are the tools jing and trang. The former is a validator for RELAX NG. The latter is a schema converter amongst dtd, rng, rnc, xsd schema languages. Both work with either the JDK or gcj (compile into native executables).

The command

$ trang status.dtd status.rnc
translates status.dtd into RELAX NG Compact (rnc) format. And now I can edit my weekly status report in nXML. The command
$ jing -c status.rnc WeiqiGao-2003-09-13.xml
validates the XML file.

Everything worked, with the minimal amount of fuss. No silly "You have to use Ant to use our tool" requirement. The

$ configure; make; make install
command makes the commands available, just like thousands of other utilities. And they are fast.

Finally there is this very readable tutorial written by James Clark, John Cowan and Murata Makoto. James and Murata are the creators of RELAX NG.

There is hope!

nXML is Fantastic

For a long time, my SGML/XML editor has been Lennart Staflin's venerable PSGML mode for Emacs.

That changed last week. I'm switching to James Clark's nXML mode for Emacs. It provides comparable editing functionality to PSGML but is easier to configure. Its realtime feedback is very helpful.

Forty-five days ago, I wrote the following in a private email:

For editing DTD based XML (human language text with semantic markups) my need is very simple:

  1. I want to be able to edit my text without too much interruption.
  2. I want a keyboard shortcut to insert an element, edit attributes, close an element, and auto-indent the text.
  3. I want an intellisense system that give me a list of allowed elements and a mechanism to auto-complete when I insert an element.
  4. I want required attributes to be automatically inserted and an easy way for me to enter their value.
  5. I want an intellisense system that let me know all the attribute names, types, possible values, default values, etc. when I edit attributes. I also want easy navigation among all the attributes.

I don't want anything else. In particular, I don't want a tree view or a generically styled view. I want an honest text view of my XML. I don't want to use the mouse.

nXML fulfills these requirements quite nicely. And it has that clean and nice feel as I edit my document.

One thing did change with nXML. It supports Relax NG instead of DTD as the schema language. However Relax NG Compact Syntax schema for XHTML as well as DocBook, XSLT are included. There are tools that convert DTDs to RNC schema as well as infer RNC schema from an instance document. So I won't miss DTD a bit.

Things to Look Into

One thing that is certain in the software business is there are always plenty of new stuff to look into. Here's some on my list:

  • Brian Gilstrap suggested that we take a look at JOnAS as a J2EE server yesterday.
  • Don Box mentioned James Clark's new XML mode for Emacs nXML. It supports realtime validation against Relax NG schema. Schema for DocBook, XHTML, etc. are included.
  • Random surfing lead me to Jena, a Semantic Web toolkit from HP Research.
  • Eric Raymond's book The Art of Unix Programming mentions some interesting tools, including xmln and xmlv, conversion tools that turns XML into a grep/awk/perl friendly format.
  • Weblog comments surfing lead me to XUL, which has been with me all along, in the form of the Mozilla browser.

Allen Holub is Evil

Search Google for "Allen Holub is Evil", and you will find a couple JavaWorld articles written in a very provocative style, and a whole lot of commentaries from various luminaries of the Java and OO world. Cedric Beust's opinions seem the most balanced and insightful.

Daniel Steinberg already started the speculation train in his Java Today editorial, predicting Allen's next target might be "Why Singletons are evil."

Here's my list of suggestions:

  • Hundred-method classes are evil
  • Pointless three-level package names are evil
  • Twenty-six megabyte rt.jar is evil
  • Log4j.jar everywhere is evil
  • Reinventing the wheel in Java is evil
  • Ad hoc "reusable" code is evil

A New System

The place where I go to have my hair cut has a new customer management system.

The old system was a green screen one. The new system has a Windows GUI.

The contrast is obvious:

Under the old system:

"What's your last name?"

[Tab] [Key in my name] [Tab] [Tab] X [Enter] "Today is your eighth cut. It's free."

Under the new system:

"What's your last name?

[Click on button] [Dialog pops up] [Click] [Key in my name] [Click on OK] [Long wait] "It's thinking." [Click on button] [Dialog pops up] [Select from combo box] [Click on OK] [Another long wait] "It's thinking again."

"You have a new computer system?"

"We had it for a couple of months."

"It sure is working hard."

"It likes to think."

[Click on Tab] [Click] [Click on Cancel] [Click] "OK, this way."

[Clip, Clip, Clip, ...]

"Do you have our card?"

"No, I don't."

"Here. Let me give you one." [Gave me a card. Stamped one star on card. There are eight little circles on the card. The eighth one is marked "Free".]

"Thank you."

Shouldn't the computer keep the count?

Access Modifier

A thread of discussion scrolled by on a mailing list about reflective access in Java. I'll capture the essence of the discussion here.

Jeff Brown started with this:

Today I discovered something that I find alarming. Try this...

       String name = "Foo";
       Field field = String.class.getDeclaredField("value");

       // setAccessible is the key here...
       field.setAccessible(true);

       char[] cs = (char[])field.get(name);
       cs[0] = 'B';
       System.out.println("name = " + name);

This code has gained access to a private member in another class (String in this case) and modified that value. I have wandered around the immutability of a String. There are worse things I could do with this.

I am interested in hearing how other people feel about this. I think this is potential trouble. I understand that this will not work under most SecurityManagers, but this is still a concern I think. I think this means that you can't really rely on private members not being modified outside of your own code. I think this means you can't really rely on the "fact" that Strings are immutable.

Kevin Heifner pointed us to an interesting link:

Yep, If you want a good discuss of this "feature" see: http://www.javaspecialists.co.za/ Go to Newsletter -> Issue 014 "Insane Strings"

Enjoy, and don't let the C++ folks have all the "fun".

Mark Balbes was quick to humorize:

Obviously, someone misinterpreted the spec. Instead of an "immutable String" he wrote an "I'm mutable String".

:-)

I pointed out that Jeff's code and the code Kevin pointed to rely on implementation details. (In fact, they behave differently in GCJ, where various exceptions were thrown.)

Brian Gilstrap then gave this advice:

If you are worried about malicious third party libraries or malicious developers inside the company, have your program install a SecurityManager and stop worrying.

And of course, in keeping with the "Martin Fowler knows" theme of this month, here's a link from his Bliki: AccessModifier.

Another Good Article

Martin Fowler has a very good article on software architectures and the role of the software architect.

Owning My First Name on Google

Shortly after I started blogging, I learned a game bloggers play. It's called "owning your first name on Google."

The idea is to make your weblog so popular that a search on Google with only your first name would result in your web page being listed first.

Jon, Cedric, Dave, Mark, Rickard are but a few examples.

But the first time I tried mine I was reminded that Weiqi is also the Chinese name of a popular game, known in the west by its Japanese name---Go. And my website was preceded by several pages of Google search results.

Things have improved a little since then. Although I still can't compete with the Singapore Weiqi Assiciation, my website is at least on the first page of Google results. And I'm ahead of www.weiqi.net!

Give me a few more weeks.