My Life as a

My Life as a Cautionary Tale.

I forgot to swap my hard-drives before installing Redhat.

It’s gone. Everything. Gone. For some reason, a couple weeks ago I bought a 25-pack of CDRWs ready to go… and haven’t used any of them except to back up some pics and Ana’s file (during her original move). All my emails for the past 8 months (since my last backup) gone. Dev work? Pretty much gone. Graphics? Passwords? Documents? Software keys? Any digital photos from the past several weeks? Gone, gone, gone.

I just got Win2k Installed again and my ADSL and am starting the long road back to recovery… it’s going to be a long evening. For those of you reading this right now, do yourself a favor. BACK UP. I’ve been wandering around my apartment during the re-install looking for “phantom” back-up CDs that I’m sure I must have made. How could I be so stupid to go for so long without making a backup? I must have made a backup… it’s got to be here somewhere… maybe I put in with the baby-clothes for safe-keeping? It must be here somewhere…

Excuse me while I keep looking…

-Russ [Russell Beattie Notebook]

Nightmare. We’ve all done something similar, although perhaps not as serious. I once trashed an entire hard disk while attempting to restore a single file. This was in the days of DOS 3.0, when the ‘Recover’ command didn’t. What it actually did was smash all the data into individual files, each file containing exactly one cluster. Nice. Mind you, back then 20 meg was big for a hard disk.

Hands up anyone who actually does have a consistent personal backup strategy (and ‘when I remember to’ doesn’t count).

Most of my stuff is in CVS on my BSD box, but if that ever dies…

Excuse me while I go and check the prices of tape drives.

XRAI. Rickard and James

XRAI. Rickard and James Strachan had very good ideas for the XRAI module. I agree with both of you! I like Rickard’s ClassAttributes and serialization idea. I also agree with James that a JAXP-style approach is needed. So we’ve done our WBD (Weblog-Based Design!) and now I have approval for the module from some of the best brains of this industry! Wow! Weblog rocks!

[Memory Dump]

Indeed. And all the bits for implementing this already exist. I had a quick play with QDox and got it printing out all my javadoc tags. Wrapping them in XML should be fairly straightforward. Building an ant task to generate all the MyObjectAttributes.xml files in the build directory should also be trivial. Then its just a matter of the return journey, which simply involves writing a default implementation of Rickard’s ClassAttributes class that knows to stick ‘Attributes.xml’ on the end of the class name and look for it in the classpath. Load the file, parse the XML, cache the Attributes in a HashMap and you’re done.

Its almost too easy…

XRAI

This one’s a new idea from me. You already know that .Net provides a runtime-based system for accessing attributes (@tags), so you can simply do something like anobj.getClass().getAttribute(“ejb.bean”) for example, whereas in java you read an xml file, and XDoclet is a compile time system which reads attributes. JSR 175 works on a runtime system, but for now what do you think about a simple simulation of a runtime attribute access API? So the idea behind XRAI is a post-proccessor ant task which reads source code and modifies the compiled classes with BCEL and injects some static fields to classes. It injects things like private static final Attribute[] attributes = new Attribute[]{new Attribute(“ejb.bean”, …)} and with a naming convention for method level tags too. You’ll be able to access the tags with an API like this: AClass.getAttribute(“ejb.bean”). Looks very simple and feasible imho. Ideas?

Ara.

[Memory Dump]

Superb. This was something I was thinking of at the weekend, how to implement .net style attributes in Java. I was thinking XDoclet or QDox would be the way to go as far as processing the attributes, but was stuck on how to weave them into the code. I initially considered extending the class with a dynamic proxy (I seem to be seeing them everywhere I look these days), but that would only work for interfaces. BCEL could well do the job, but how would you go about injecting the methods into the API? I’m curious.