Archive for December, 2002

Java Number Cruncher

Saturday, December 14th, 2002

Damn. Don’t you hate it when you hit backspace in IE and it doesn’t delete but takes you back a few pages…losing your form.

Anyway. I got a nice book from a book club the other day, it’s Java Number Cruncher by Ronald Mak and looks to be a very interesting read.

In other news, I cooked my first roast dinner today and am hoping the pots and pans in the kitchen will clean themselves.

MathLib and Why I dislike GPL'd Java

Saturday, December 14th, 2002

I’ve a desire for an embeddable mathematics language. One that actually speaks in maths and not in computer-tongue.

It needs to support complex numbers, bean-proportied in/out params from the java container, operations; both written in ‘math-lang’ and in Java, have a default set of operations [sin, cos etc], and probably a few other things. I’d like to avoid if/else stuff, but it would be nice someday to have it able to speak set-manipulation things so that an equation can parallelize itself, or use a summation as a for loop.

http://mathlib.sourceforge.net/ is the best [only] project I can see this side of Mathematica that looks able to do this, and Mathematica isn’t up to the job. Java API on Mathematica is a big hack from what I can tell.

Mathlib is GPL’d, which I usually avoid. Mainly out of Apache habit as we can’t redistribute GPL or LGPL, even unchanged, but also due to the usual fear, what if business demand that a piece of code be deployed on customer machines as an applet and not as a servlet. Am I now shattering GPL when it goes? Or when code is sent to escrow. So this is all a pain.

Why do I hate GPL Java though? Because, in general, the large amount of open source Java is done under lighter licenses. When I do come across GPLd projects, it always seems as though it was created by GPL users from another language [where it makes more sense/is dominant, ie) C/C++] . For example, immediate problems with Mathlib:

1) Package names are capitalised. Some class names are all lowercase.
2) Their build system also builds the dependent jars. So it builds JUnit. This seems very odd, unless they’ve forked JUnit. Why compile a dependent jar from a snapshot of the source.

I’m probably being overly critical as I’m overlaying a belief that people dabbling in Java create poor Java. Typical “I can only do Java” snobbery. I know my perl is weak, I don’t do clever things, and my C is weird as I try to write it all like Java or Pike.

Here’s hoping I learn more humbility [and lose my habit for creating new words… like prepend(?)] and that MathLib is the tool I’m after.

Ixxx interface convention

Tuesday, December 10th, 2002

Bob Lee talks about naming conventions for Java, including the Ixx interface habit. Although against it, he says there are no problems with it. I beg to differ :)

The problem with ‘IPerson’ is it makes the developer aware that they are using a fake type. They don’t want to think in terms of IPerson, they want to think in terms of Person. Talking about Persons makes sense, about IPersons? No. So why is it bad to use IPerson? Because when we code we should talk about the Type, and not the Implementation. Interfaces rock because they allow us to separate Types from Implementations [I’m having a capital letter day!]. When I make an interface named Person and a class named CPerson, or PersonImpl, or SimplePerson, or WhoCaresItsJustAnImplementationOfPerson, then I will properly talk in terms of Person, except for the single location where I make Persons. And even there I might use a PersonFactory [hmm. Womb interface? *grin*] to create the Persons.

IPerson is highly dangerous and should not be on ANY coding standards. We may code classes, but we should think in interfaces for our Lego-work.

Galley

Monday, December 9th, 2002

A week back or so I vaguely mentioned a Java project which would show web directories using templates. I want it as a generic solution that will wrap Russell Beattie’s Manywhere Scrapbook and be able to do other things, like a view-cvs.

As my wife has lots of DisneyWorld pics to put online, I did some work on it while on holiday. Here’s the idea:

There’s a class named CatalogServlet. It is in a WAR and is configured with a link to a machine local directory [yes I know, I’m not meant to see these in a container, atm I don’t care]. It then shows that directory in some manner, and when a sub-directory is clicked upon, it shows that directory. When a file is clicked upon, it opens that up in some manner, and icons are shown while in directory mode etc. At least it could do. The aim being to make things very pluggable.

What is this in reality? It’s a read-only Apple-Finder/Windows-Explorer style program which the server-user can configure with different skins etc. So a scrapbook just becomes a skin. This is pretty much how Apple do things in iDisk, one ‘hard-drive’, multiple ways of viewing things.

So basically I’m thinking of a servlet, pointing at a file-system to use as its root, with a set of parameters configured and a set of skins [velocity templates??].

I dunno. I think there’s an idea under the muck, but chances are it’s already out there.

JDJ Vol 7 Issue 12

Monday, December 9th, 2002

Latest Java Developers Joural turned up today. So I thought I’d rumble through the pages, have a moan and a praise. [Spoiler: Buy this issue. It’s good.

The first thing to catch my eye was a “Review of the PetStore Revisited” article. Arrgh I thought, please, stop it already with the PetStore crap, we don’t need this again and again as if it was some holy grail. So imagine my surprise as I ploughed on in to Alan Williamson’s Editor’s Editorial to find him saying exactly the same thing. “Aren’t you getting sick of all this propaganda”. A warm feeling in my tummy, and not just because I had the luck to think the same thing as he.

The guest editorial is an aggressive rant by Bill Roth, a Sun employee who once upon a time was involved in the J2EE world at Sun. And… it’s a damn good editorial. He pulls no punches, gives an opinion and offers an interesting set of arguable topics. Ajit Sagar’s J2EE editorial afterwords can only seem a little muted by comparison, and yet he’s delving deep into [most] of our backyards, open source Java. I disagree with his basic point, that commercial companies are adopting open source rapidly, rather I think that they’ve had to accept open source as open source projects have become the de-facto options. Ant, Tomcat, JBoss, JUnit being the big cases in point. Still, maybe it’s the advantage of 2 good editorials before it, but this one seems worth the ink too. And the title “Tis the season of Amalgamations” is oddly portentuous of IBM/Rational + Borland/Togethersoft.

The first article is the afore-mentioned PetStore one. But it’s not an article, why, it’s Rickard Oberg’s much referenced refutal! I can only assume that JDJ moved quickly to get this scalp of an article, good work, and the first sign that JDJ might be stepping up to the gaping hole left by Java Report [yes I’m biast]. Just a page, but a good headliner, and still pretty relevant.

The next article is on Lucene, the Apache Java search engine. I consider anythiing that is on my ‘to-learn about’ list as a good article choice, so this gets the thumbs up. I think it’s written by a Lucene user and not a Lucene developer, so seems even better. [I might have this wrong].

Next we have ‘Webtop Architecures for J2EE’. Okay, well the name certainly confuses me. Wtf!?! Well, it’s about the move back to heavy clients/desktops, so no great shock there. It reads well, and dfinitely seems to have great ideas. It’s written by a guy from Sitraka [now owned by Quest, what’s gonna happen there I wonder] so there might be some corporate nudges in there. I regret the fact I wasn’t coding a decade ago at the end of the client/server days. Lots of experience from back then ought to be increasingly useful nowadays.

Next we have an advert for JRun4. Macromedia have mullered JRun. JRun has 10,000 organizations deploying on it [JBoss and Sun have 2 million downloads a piece]. I bet that figure also includes the days when JRun was THE servlet container for windows. Now that position seems mainly earned by reputation/habit. The only reason I see for using JRun is if you’re big into Flash, else go with Pramati/JBoss/Orion.

Enough of that :) Back to real articles. J2SE editorial from Jason Bell. An interesting call to arms concerning the lapsing of a JSR for a Travel Industry Reservation Booking Foundation API Specification due to lack of community support. Well, I don’t imagine it’s a common itch, so I don’t expect open source projects to be interested in it [unless you’re a developer for an airline], and if the big companies who run lots of Java weren’t biting, well there’s got to be something up. Maybe the airline people should look to themselves and realise that to create a de-facto standard they don’t have to use the JCP. Ant is the de-facto standard for building Java programs, but didn’t need JCP to get there.
Equally, maybe the JCP needs to consider ways in which existing defacto’s can become de-jure without the politics of a member of the JCP wanting to push aspects of their solution into that de-facto [JSR Logging. In fact the ‘defacto’ was IBM logging and the pushed aspects were from Log4J. Except that IBM’s wasn’t the defacto. Big problem.]

So our first article on J2SE. These are usually the best in the magazine as they’re the most applicable. The first is from Richard Ross and is apparantly a JDK 1.4 article on something called a Command Processor. The JDK 1.4 parts aren’t too obvious until you realise Regex’s are being used. That was all that seemed 1.4′y about it. Minor grumble. Richard’s solution seems much like BeanShell or JPython. He discusses how he handled the parsing and then delves into reflection. Nothing really stunning in the concepts, but it seems again to be a good article. Good set of basic things put together into a working application with complexity.

Next up is an article on ‘SpringLayout’, a layout manager. I’ll file this article away in my mind as I’ve not got a great use for GUI stuff currently, but it’s good to see this article here. Until now GUI Java really meant getting JavaPro. JDJ ought to contain a GUI article a month, it’s a very important topic. Hopefully Jason Bell can arrange for one of his J2SE articles each month to be a GUI based one. Have they done thinlets yet? I’d love to read about them. They may have, part of the reason for splurging out these views of the magazine is to burn them into my head more.

Next we have Jason Briggs’ J2ME editorial. Yet again I apologise, but J2ME isn’t a biggy for me. The Zaurus is as close as I get [and lusting after a mobile phone running the same OS as either the psion or the zaurus… but mobile phone tariffs scare me]. Still, interesting to hear that Qualcomm are likely to release a Java Chipped device. Interesting bit that Nokia is releasing a game platform???

J2ME articles: One discussing the cross-platformness of J2ME, and another on the future of ‘ad hoc networking’. PDA’s and P2P.

Product Reviews: Adalon 2.2 [No, not Avalon]. Interesting, seems to be a web-application requirements creator to application [using Struts] generator. I like the look, and as I’ve already accepted that Struts is becoming defacto, I’ve no problem with the format it outputs. Might even take some time at work to play with a demo.

Review #2: Rational XDE. A bit heavy for me, the Rational way. Usually scares me off reading about it and it costs 3.6k USD. Basically I’m not going to get to use it, IBM just bought em so it’s future is unsure, so I’ll wait until I hear good things. Anyone out there use it???

The Job section. As usual I find this quite off the mark for me, but I live in a city where I know pretty much all the companies using Java and which have jobs going. Often I know the guy who left the job too :) So their talking about how people are moving between jobs quickly, and not ending up with a resume [CV!] that isn’t focused is of little avail to me. Until I sell up and move to a Java city, jobs for me are more a question of places who will hire and pay enough. As with everyone else, that paying enough no longer exists. I know a place looking for 3->4 years experience budding architect and paying 40k ish. Fun eh?

Last section…. it’s the Spotlight on Open Source section. It seems to have taken over the back page! [Actually I knew this. I always start to read magazines backwards… football pages on back of newspapers got me doing this]. Justen Stepka uses his less than 1 page to sell Open Symphony. Great. These guys have what seems to be a great community [though I always thought it was one that was hard to get into… I must try to become more a part of its user community…] and they deserve more publicity than they get. WebWork is growing on the blogs, OSCache I’ve seen Jim use at work, SiteMesh I used a year back at Ironmax, it did the job, and OSWorkFlow is yet another workflow thing. No idea on that.

The SoOS section is great. Please keep it JDJ. Get Lance Lavendowska to write something about the Roller blog. Get Jason van Zyll to write about Maven. Get an Apache member to write about Jakarta, Sam Ruby would be a good choice. Let Marc Fleury tell us the future of JBoss, or… and this is for a different section, talk to Rob Oxspring about the Jakarta newsletter. How about putting this on a page of JDJ???

I love this issue. It’s rejuvenated my belief in magazines [well, resparked anyway] and I will spend the next month nudging the mailbox for the next issue.

Jakarta Commons - a good thing?

Monday, December 9th, 2002

[Warning. I’m going to ramble a bit. None of the below is said with any firm conviction that it is the ultimate truth, just ideas and thoughts that I think I’m still trying to iron out]

As some may know, I accidentally stumbled into the Jakarta Commons project about a year ago. It’s been an interesting ride and it’s very fulfilling to belong to a community that is getting good media currently, people seem to assume that products from Commons are good products [and I do have some arguments for why they are just that].

But is all as it seems? There is a hint of rivalry with the Open Symphony guys, there are sourceforge projects that lurk with Commons-like functionalities, there are creations from other Jakarta projects which clash, such as Avalon which is pratically an integrated-Commons, and Turbine’s creations, such as Maven. Rivalry is often a very good thing though. There’s the new Apache Commons project which looks to become lord-high of the ASF Commons [I’m being bombastic]. But is it working?
Jakarta Commons was created as a place to place sub-projects from other Jakarta projects which could be shared between the Jakarta projects. It contains a sandbox which in principle is the Jakarta incubator, in terms of growth of code, and not the Apache incubator which is more of a welcome committee, it contains various ‘Commons-proper’ projects, and the charter states that it is also supposed to have a ‘directory’, which in reality sounds much like the oft-desired CJAN [which despite many false starts continues to remain motionless].

The charter defines that each project [actually it says package, it doesn’t seem that the concept of many projects was originally intended] must have a clearly defined scope and purpose. It also defines that dependencies must be clearly documented and also included in the MANIFEST.MF, and that there be a PROPOSAL. Then it goes on to waffle about the directory again, which hasn’t arrived yet and raises doubts in my view as to whether the charter is relevant to the current Commons.

So… is the Commons a success? I don’t know. The Charter states that the focus of Commons is on developing projects that can be reused by multiple projects, both inside and outside of Jakarta, but there seems to be a deep level of NIH [Not Invented Here… took me a while to learn this one, but it gets used at Apache/Jakarta a lot]. Commons Project’s are expected to come out of existing projects, and mostly they do, but often it feels as though the developers drop that code, leave it lying to be picked up, rather than continuing to support it.

The thought is that ‘Commons’ developers will pick it up, but by my reading of the charter there are not expected to be Commons developers. So when the Struts mailing list tells a user to go ask a question about BeanUtils [a project that came out of Struts… I think??] to the Commons developers, it’s a clear sign that something is wrong. Either with Commons projects or with the Commons charter. Either the concept of a Commons developer needs to be blown apart, and no committer allowed to Commons without being a committer elsewhere [and I’d not be a big fan of this eh? :)] or the Commons developer needs to be ratified and the concept that Commons exists as a self-standing entity should be considered.

Here though there are issues. Commons-sandbox is a misplaced and obscured incubation tool. It works nicely as a typical sandbox for Commons-proper projects, [and I must admit that in Lang we’ve used it for this at times, like a branch of the main Lang branch], but for incubation I’m not convinced that it is managed enough, or that its current use fits the charter.

Commons projects are supposed to be created by groups from another parent project. They are expected to be its major customers and direct which way it goes, however if they don’t maintain and develop it actively, and a developer arrives who is solely concerned with that component, then it becomes a battle between the person who is scratching an itch, and the consumer who has commit rights.

Commons is also a true bazaar style of open source development [the way it currently runs anyway]. There are wise old heads in the Commons who keep people obeying the taboos and mores, but their social role is more to keep people from flouting the spirit of Commons. A project can be created by one person, who then loses the time to work on it, picked up by another, then another, grown into a larger project of a few developers, and then dropped again while it goes into temporary hibernation, while consumers submit patches and bugs to a quiet marketplace. It’s even more noticeable in the areas of Commons that have my true interest, the Utilities. Lang, Collections, IO, Util, BeanUtils [DbUtils, though I’m thinking this is one of the bad cvs sandbox projects. I want the API to exist, but I want to use the community to build it.. against Commons charter]. With these, getting the API right is very important as it is the chief reason for existence. Maintaining a sense of coherence between the projects is also important, which is hard. Imagine a marketplace with 6 marketstalls. Even if they mainly sell different products with only some cross-over, do you expect them to work well as a distributed team? Then throw in the fact that the people working at each stall regularly cross over to do some work at another.

In a true bazaar development environment, how does the vision get maintained? The cohesion?? There is no such thing as a Linus Torvalds/Benevelont Dictator.. that’s not a true bazaar environment. Instead there’s lots of hawking and selling, buying and cursing. There’s no reason for projects to share aims and goals, but it’s obviously difficult not to focus on such.

Then I look at the JADE, Java[tm] Addition to the Default Environment. This project seems to be more of a cathedral. There is a benevolent leader, the parts are available separately but they all follow a shared vision…

When a bazaar becomes successful and starts to attract many consumers, does it have to turn into an organized marketplace or grocery store?

The town in which my parents live used to have four butchers, even up until a year or so ago. Now I think the number is just two, and they will probably die out as large supermarkets [grocery stores to Americans] take over their trade. Is the analogy going too far, or should bazaar open source environments look to their future and how they can build their own cathedral?

Java Generics

Monday, December 9th, 2002

I didn’t notice this on other Java blogs… so just in case people missed it:

Sun hava an article on using Generics in Java 1.5.

Personally while Generics sound nice and exciting, I’m not convinced that they’re better than a good library of TypedCollections [ie) classes that do runtime checking against a specified Class]. My lack of convincing is mainly due to lack of exposure.

Something that does interest me is the job title of the author of the article: Market Development Engineer. Am I the only one who thinks that title sounds scary….

NanoTitan

Monday, December 9th, 2002

Builder.com decided to publish another set of tips of mine as an article. No complaints from me, more exposure etc, and more readers comments to cower in front of.

I referenced an open source component that a company named NanoTitan created. A simple thing which takes a snapshot of a GUI widget and saves it to file. I say simple, but there are some intricacies involved to do with GUI components loading and being painted that mean it’s not as easy as I first thought when the idea occurred to me. So using their version makes sense.

More importantly, NanoTitan have a far more extensive library of Quantity objects, a competitor to the relatively well-known Jade library. NanoTitan work with nanotechnology…. which has got to be the _cool_ tech until Quantum Computing turns up.

SQL Book

Sunday, December 8th, 2002

The SQL book I mentioned in the previous blog entry is:

SQL Performance Tuning by Peterulutzan and Trudyelzer.

Back from holiday

Saturday, December 7th, 2002

I’ve just spent the last week in Disneyworld, the home of corporate America. It was pretty relaxing, some of the rides are very cool, and the habit of dumping you into a shop at the end of each ride became the holiday’s joke.

I managed to get some coding done on Commons IO, but most importantly I got to read. My biggest irritation with coding is that it diminishes the time I have to read. Away from computing I finished off Mary Gentle’s Lost Burgundy series, a pretty original set of books, and read Ray Bradbury’s Fahrenheit 451, which is a great book.

Back with computing, I read Bruce Momjian’s Postgres book [blue elephant on the cover] and found it, and postgres, to be full of hidden surprises. This is a very good book and worthy of recommendation to anyone interested in postgres. My one complaint is that it can be a bit confusing as it assumes you have a database created and sends you off to the ‘Installing Postgres’ appendix to find out how to create your database. I used Fink’s Postgres install to play around and my chief complaint there is that it doesn’t appear to compile the JDBC jar.

The first book I read on the trip, on the flight out in fact, was Ed Yourdon’s Death March. This was truly inspirational reading. While I’m not going to claim that the project’s at work are death marches, there’s definitely some ideas I can apply. For me this ranks up there with Mythical Man-Month and the Deadline as books every coder should read.

Lastly, I tried to read OReilly’s Physics for Games Developers, but its insistence of providing examples in feet and inches really grated with me. Do American kids still get taught science using such antiquated means?

I’ll gamely battle on as the examples are not essential, but it interrupted my flow.

Now that I’m back I’ll return to reading Optimising SQL on Safari at lunchtimes, which looks to be a very good book. My biggest tip for any frustrated readers out there, get a Safari account, force yourself to read for an hour a day at lunchtime. It mounts up. I’d provide a link to the SQL book with the complete name, but my connection to amazon/safari is acting up from home.