Archive for September, 2003

CHoosing a front-end tech

Tuesday, September 30th, 2003

I want to do a nice simple website. Something I’ve done before and will do again in the future. It will have a RO consumer view and a RW admin view.

I’ve got a schema in postgres, and a hibernate mapping that is working nicely. Now I need to choose how to do the HTML [with however many layers in between]. It should have minimal amounts of coding, but should not have bits of Java written in the JSP [or equivalent, ie) velocity] page.

Options I’ve considered so far:

JSP: I like using this as it’s simple, easy and fun. There’s no hibernate taglib, and I don’t believe in writing bespoke business taglibs, so I’d have to make at least some kind of basic hibernate taglib or hibernate/OJB pluggable taglib. See how quickly it gets overmodelled :)

Velocity: Good featureset a year ago. I’d be using JSTL/Tomcat,, maybe even Tomcat 5/JSP 2.0, so I’m not aware of anything [except a certain bash syntax] that velocity would have over it.

Struts: I’m not comfortable using Struts. Even with xdoclet to generate things, it involves writing Java classes which I don’t think I should need for a basic system. Ages back [Struts 0.3] I hacked it so that I could throw Maps around instead of Forms and wrote generic actions. I could go that way again. I don’t think Struts is dynamic and fun enough for what I want.

WebWork: Heard good things. Looking at the docs though I find it hard to see what the difference is between that and Struts. Seems to have the same overall design concepts.

Tapestry: Could be a possible. I ought to rethink it. I hated Tapestry a year ago as it seemed to stop me being able to do what should be simple things. It defines a simple-world, and is a pain to get outside the borders. However, I’m considering an easy system and would accept such a strait-jacket if it means I can be rapid.

Proprietary: A few years back in a previous job, I designed such a system. With some newer ideas I could spend time using the site as a driver for my own version of this system. [NDA-wise, I promised to not look into the concept for a year after leaving the company, it’s been 2 years now]. I’ve even recently come up with a name for it.

What and who else is there? JSF is too new, and seems more work than Struts. Freemarker is something I’ve only vaguely heard suggested. BeanShell pages? Do they exist for the latest version of BSH? Servlets are probably too much work.

Any opinions are gratefully received.

Xxx.class = a hack

Tuesday, September 30th, 2003

I remember a friend back in the UK who is big into looking at class files complaining that .class files were a big hack. Now I understand why:

list.add( Object.class );

is also known as:

list.add(class$java$lang$Object == null
? class$java$lang$Object = class$(”java.lang.Object”)
: class$java$lang$Object);

plus a hidden method and variable:

/*synthetic*/ static Class class$java$lang$Object;

/*synthetic*/ static Class class$(String x0) {
Class var_class;
try {
var_class = Class.forName(x0);
} catch (ClassNotFoundException x1) {
throw new NoClassDefFoundError(x1.getMessage());
}
return var_class;
}

Hibernate + Javagroups + JBoss = good

Wednesday, September 17th, 2003

Gotta admit, I think the JBoss consolidation is a good thing. Open Source Java needs a figure-head, and JBoss are the only people stepping up to the plate. Even better, they step up to the plate with money in their hands.

The bad side, it’s GPL. I’m happy to use GPL at work, but I avoid making such decisions as I’ve no idea what the legal standpoint on Java, GPL and distribution is. This is why I release my own code as BSD, I’m comfortable I’m not breaking licences/contracts when I use it at work.

Some might argue that Jakarta is an OSJ figure-head. I can definitely disagree here. A year and a bit ago, this might have happened, but Apache have no desire to have a Jakarta-figure-head company. The Jakarta brand is dead, long live the Apache brand. This is a large part of the restructuring you see at Apache.

Geronimo. Is this some insidious attempt to defeat JBoss? I don’t think so. I think it’s a bunch of people sitting around a table with pints [or maybe on a mailng list, but that’s not as sexy] complaining about the fact that JBoss is still not ‘J2EE’ certified. It seems the problem is that JBoss Group LLC want it for free and Sun don’t want to give it to them as they’re a company. I agree with Sun here, but surely it would be easy for JBoss Group LLC to create a non-profit org who own JBoss’ copyright? That would nip Geronimo in the tooth I think.

However, I suspect that we’re just reaching a point where open source Java is now big enough to support the endless GPL/BSD religious wars. JBoss should ’sign’ FSF as a strategic partner for GNU Java, hand their products over to GNU and use the FSF as their non-profit org.

Evolution + communities

Wednesday, September 17th, 2003

I suspect this is something big in some area of academia I have no clue about. Still, I enjoy waffling.

I like the idea of evolution, I’ll admit to it. It’s not the only game in town, but it’s one of the fixtures. If it applies to biological beings, why doesn’t it apply to other things? Planets, stars, time, groups of people.

I’ve read occasionally of memes. The idea equivalent of genes. I need to read on them someday. What really interests me though is the evolution of groups of people. It strikes me that communities are made up of nodes, and that one of the prime roles of each node is as a connector between that community and another [or more].

Anyway, point of the blog entry is, does anyone know of any good books on the subject? Should I be reading Dawkins’ selfish gene for memes, or is there something else that focuses on communities rather than just ideas?

Commons-Lang, a bile answer

Sunday, September 14th, 2003

Ooo. We’ve been biled.

Anyways, responses.

Why use Commons-Lang and not My_Own_Collation.jar?

Mainly for liability. I found that if I used my own code at work, it was nearly always owned by the company I worked for, or they did not want me to use my own code. I have no desire to break all the documents jobs force us to sign. Having some of my code in Lang is a nice way to protect myself.

Why do I use Commons-Lang?

Well, because it’s got lots of my_own_collation code in there anyway. No idea about the rest of you.

Do I think Commons Lang is an amazing project?

God no. It’s all pretty much basic stuff, though people often come up with weird situations for serializing and inner classes that screws things up. There’s a lot of created-by-committee code, that the ASF way does specialise in, which has good and bad sides I think.

Why is there lots of null-protection going on?

The original StringUtils was the backing for Jakarta String Taglib. Rather than have the taglib code worry about how to handle nulls all the time, I let the underlying library do so. It’s stuck and there’s enough people who like it to keep it there.

Are you lazy if you use Commons Lang?

Nope. You’re just a believer in code-reuse. The other side of the coin is to never re-use code, which I think has some major pluses. If I always code from scratch, I have far less in the way of dependency management to worry about. At the same time, I end up with a million pieces of code to fix when I realise that using toUpperCase for capitalising a String is not globalised.

Commons-Lang is full of stupid code!

First off, I’ve the highest Java-IQ on Hani’s scale that I’ve heard of yet, so I probably don’t qualify to answer this question. But yes, it’s stupid, useful code.
Clever code is not something I would want to work with as it’s usually ‘too-clever’.

JFreeChart JSP Taglib

Friday, September 12th, 2003

This is so so sweet: http://cewolf.sourceforge.net/. It’s a Taglib for JFreeChart, and it works nicely. It took me a few hours to get through minor issues etc, but once it started working it worked nicely. Main problem is just that things can error in ugly ways rather than giving the exact problem you have. Immaturity basically. Access to the source made it easy to deal with.

Creating a new set of graphs is wonderfully quick and easy. Especially with the lovely SQLDataProducer class. I’m a bit unsure about what JSTL is doing with Connections in the session under the hood, but it’s preferable to having to deal with them myself [at least once JSTL is mature enough to have dealt with it].

JNLP + WAR = pain

Friday, September 5th, 2003

Having a JNLP in a WAR seems a real pain.

I believe that a build and a deploy are different concepts. A build is platform independent, a deploy knows the platform it is going to.

A WAR is made at build time. It is a packaged structure ready for deployment anywhere.
A JNLP has to know about deployment time. It has the codebase hardcoded in it [as do applets in web pages in wars I guess. Potentially].

Problem is… the JNLP is in the WAR. So I have to unpack the build to do the deployment time configuration.

Or, my build has to know about deployment, which is poor I think.

South Park Me

Friday, September 5th, 2003

Graphic Designer at work created South Park pictures of us all. Here’s me:

Evil email viruses

Monday, September 1st, 2003

Gah. Some have said that non-Windows users are not much inconvenienced by the Windows viruses that fly around, but it’s coming close to hurting me.

My usual inbound transfer is a few gig. The outbound is 6 or 7 gig, making a grand total of 10 or 11 gig.

August was different. Inbound was a high 7.5 gig. Outbound was 9 gig. Overall, nearly 17 gig. All the increase due to the email I bet. Once I get over 20 gig, I have to start paying. Soon I’ll be paying for worms.

8/10: Self-confessed Java Idiot

Monday, September 1st, 2003

So the Bile blog’s Java Idiot thing is bounding around again. Figured I’d declare myself to be the number one Java Idiot [unless a challenger can be found].

Answering the questions, I give myself a score of 6.5 out of 10 for Java idiocy, based on 5 yes answers and 3 maybes.

With reflection, I could probably even suspect that JBoss/IBM/Weblogic are unlikely to have any serious challengers business-wise, even if others are able to challenge them on technical prowess. That takes me to 7.5. I definitely have more than 3 commons libraries in my average project [bit of a trick question though, I’m a coder on more than 3 commons libraries], so that takes me to 8.

All I need to do is get addicted to AOP, be sure I’ve quoted Bloch and realise that using OO at work is a hopeless crusade. So 2004 is my year to make it to 10/10.

[Oh…and why am I happy with all this? Because the Bile Blog exists to show how easily the crowd is lead by someone blogging. Of course, I could just be running in the other direction. The 10/10 is a joke… honest.]
****************************

Here’s my comment on his site:

* Yes to Struts. Though not by my choice.
* Yes to JSF, because the spec always wins.
* Probably to Bloch, because his book has good arguments.
* Yes to Maven. It makes my life easier.
* Yes to Eclipse on non-win32. I’m tentatively using it 10% of the time on OS-X.
* Damn. No to J2EE. Pramati. Orion. Defunct-HP. Please change this question.
* Yes to Linux. About the same amount of time as it’ll take for the desktop to be unimportant and the new ‘metaphor’ to arrive’.
* Probably. 4, 5, 6 are all reasonable averages.
* Damn. I fail again. AOP doesn’t rock my boat.
* People do seem to get ‘Data’ object and ‘Logic’ object a lot more easily than real OO concepts. I have this nagging suspicion that no one has found a way to teach OO to VB-ers.

5 Yes’s and 3 maybes. So a score of 6.5. I think that gives me the highest JIQ here and makes me very proud.