Pushing the envelope

Darren's take on Java, agile methods, cool open source stuff, interesting technologies and other random wanderings through the land of blog.
Updated: 26/01/2003; 11:49:59.
Places to go
Apache Jakarta Project
c2.com
ExtremeProgramming.org
OpenSymphony
XProgramming.com
XP Developer

People to see
Russell Beattie
Eugene Belyaev
Tony Bowden
Mike Cannon-Brookes
Jeff Duska
Paul Hammant
Scott Johnson
Brett Morgan
Rickard Öberg
James Strachan
Joe Walnes

Things to do

Subscribe to "Pushing the envelope" in Radio UserLand.

Click to see the XML version of this web page.

Click here to send an email to the editor of this weblog.


That was the day
September 2002
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30          
Aug   Oct



Archives
December 2002
November 2002
October 2002
September 2002
August 2002

Listening To


Valid RSS

Click here to visit the Radio UserLand website.

  30 September 2002

Trust us for web services, says BT

From January, BT will offer a managed Java 2 Enterprise Edition (J2EE) or .Net web services deployment environment, starting at £20,000 per month, for companies to test proof-of-concept projects.

Of course, I imagine the price to host an actual live project won't be quite so generous. They have to cover their costs after all...

Lets see, Kattare for $54 a month, or BT for $30,000. Tough decision.


10:23:48 AM      comment []

  29 September 2002

Just seen an advert for Opodo, the online travel company set up by BA among others. Wonder how many domain names they tried before coming up with that one?

10:56:56 PM      comment []

  28 September 2002

Hi there... I'm back. Thinking about what's next.

Has anybody downloaded the Sun ONE Application Server v7.0? From what I've read online, it's supposed to be completely new. It's not iPlanet or NetDynamics or a combination of the above.

-Russ [Russell Beattie Notebook]

I did some informal benchmarking of servlet containers a couple of months ago, and Sun ONE did very badly. It was 50% slower than Tomcat and Resin, crashed under load, and was a pain to work with. It also mangled application URLs, so http://myserver/myapp/servlet1 on Resin/Tomcat would become something like http://myserver/NSApp/myapp/servlet1 on Sun ONE. It may have improved since then - cos I don't think the one I was using was all new (NSApp? Netscape Application server perchance?).


11:14:26 PM      comment []

  27 September 2002

Just spend an enjoyable couple of hours dismantling and moving my desk and two large pc systems out of my bedroom and into my freshly vacated spare room / study. How many cables? The most fun part was ripping up the carpet to reroute my ADSL line. So this post is sort of a test.

3:54:06 PM      comment []

  26 September 2002

Code and Personality.
The Virtue of Engineer's Cynicism. DarwinMag.com has run a column of mine on why the cynicism so typical of engineers is a virtue. [JOHO the Blog]

Brilliant link in that post: Code and Personality [Brett Morgan's Insanity Weblog Zilla]

This made me glad all over again that I don't do C / C++ for a living.


4:54:11 PM      comment []

  25 September 2002

Continuing the subject of XDoclet, I have a vague recollection of someone (can't find the reference, sorry) mentioning using it to implement C# style Attributes in Java. Interesting. Add XDoclet to the pile of things to learn more about...

10:45:18 PM      comment []

QDox 1.0 Released - http://qdox.sourceforge.net

This is the first opensource release of anything I've made in months - I've been a busy boy :)

QDox is a small footprint, high-speed Java and JavaDoc parsing library. It was born out of my own frustration with how slow code-generation tools were that rely on the Sun JavaDoc processor. This is much faster replacement. On my home machine it takes 16 seconds to scan 3000 files (courtesy of Apache CVS), where Sun JavaDoc takes just over 2 minutes. The library has no runtime dependencies and a simple and intuitive API.

MockMaker now uses QDox to generate mock objects from source code as part of the build process.

[Joe's Jelly]

Excellent. Any plans to integrate QDox with XDoclet?

On the subject of XDoclet, has anyone tried using it to implement design by contract? There's an article here describing an implementation of DBC using dynamic proxies and the doclet API. I wonder if XDoclet might provide an even slicker solution.


10:17:04 PM      comment []

  24 September 2002

Class.forName() is evil....

We've all done it before I guess. Called Class.forName( "com.foo.MyClass" ) to load some class at runtime based on some configurable class name. At first it seems very groovy.

However this does not work very well in application servers, containers or various environments like Maven, Ant, JUnit etc. The days of everything being in the system class loader are over, now we need to live in a multiple-classloader world.

Solution? Try use the current thread's context class loader or the class loader used to load your code. So try replace this...

Class theClass = Class.forName( className );

with this more verbose version (which could easily be wrapped in a helper method)

Class theClass = null;
try {
    theClass = Thread.currentThread().getContextClassLoader().loadClass( className );
}
catch (ClassNotFoundException e) {
    theClass = getClass().getClassLoader().loadClass( className );
}

Henri, this could be a possible addition to commons lang?

While we're talking about living in multi-classloader worlds, bob's new project ClassWorlds looks very groovy.

[James Strachan's Radio Weblog]

This certainly goes a long way towards solving classloader issues - I always seem to get bitten by XML parsers in this regard. What it doesn't always solve is the situation of colliding packages. I've hit a situation where the app. server is using a version of Xerces thats older than the version my app. wants to use. This gets messy, and the exact behaviour depends on your app. server's classloading policy (it doesn't help that the servlet spec. appears to be in conflict with the java language spec. on the issue of classloader delegation order).


9:43:16 AM      comment []

  23 September 2002

Just been playing with the EOB-Prevayler demo. Very cool. The app that wouldn't die. Bounce the client: state is preserved. Bounce the server: state is preserved. Database Not Included (or required). Even cooler: open 3 or 4 windows and watch them all update when one is changed. Very, very cool.

3:22:52 PM      comment []

Transparent RMI. There's an interesting article over on JavaWorld: "Empower RMI with TRMI". Transparent RMI makes it simpler to create RMI services. No more extending Remote and having every method throw RemoteException & it also centralizes error handling on the client side. It appears to be using dynamic proxies to simplify things... I need to investigate this further. [Otiose Cognitions]
While you're at it, have a look at altRMI.

11:31:55 AM      comment []

Persistence.... I've been looking into a lot of different persistence strategies for "Java" lately for projects I'm working on at work. Currently most of our projects still use hand-coded SQL (JDBC) which is far from desirable. [Otiose Cognitions]

I hear good things about Kodo JDO. Might be worth a look.


11:29:38 AM      comment []

Free learning from MIT. Nice of them.

12:03:30 AM      comment []

  22 September 2002

Applet security redux.

I have finally come upon a solution that is less expensive than paying the $200 plus $100/year to Thwaite for a digital certificate. I just put the following into my Java Plugin JRE's java.security file:
   grant codeBase "http://rollerweblogger.org/ekitapplet.jar" {
permission java.security.AllPermission;
}


Now, this is fine for me because I trust myself. But, for example, what if Anthony Eden was to ask his users to do this, substituting roller.anthonyeden.com for rollerweblogger.org in the above snippet? Anthony would be asking his users to trust in the following things:

  • Neither Howard Kistler, Dave Johnson, nor Anthony Eden have put no malicious code in Ekit
  • An evil hacker will not break in to Anthony's site and replace ekitapplet.jar with malicious code


Is that too much to ask of Anthony's Roller users? If it is, then we need to buy a certificate for Ekit and hope that this one certificate would be good for all Roller users.

BTW, this is my first Ekit post using Mozilla.
[Blogging Roller]

Presumably, even with a certificate, users would still have to trust that none of the authors had put any malicious code into it? All the certificate does is assert where it came from. You are still required to trust the source.


11:46:35 PM      comment []

BCELify

BCEL. A tool to build classes on the fly and output them as bytecode. Complex stuff. Luckily it comes with BCELifier. This tool can take an existing .class file and generate the BCEL java source code to build that class. Very cool.

What this means is that if (like me) you find BCEL itself a mite tricky, you can write your class in the normal way, compile it, BCELify it and end up with the source code you need to feed BCEL with to get the same result. Groovy. This reminds me of my dim past, recording VBA macros in Excel to find out how to do something, then hacking the generated code into what I wanted. [Pushing the envelope]


I'm really not sure how I feel about this. We are really re-treading the boards that lisp trod with it's macro system many moons ago. I suppose the complexity of our solutions is the result of refusing to swallow the lisp/scheme mantra of code and data being one.[Brett Morgan's Insanity Weblog Zilla]

Indeed. I'm still looking for the 'perfect' language. Java with closures, multiple inheritance, dynamic execution (like Perl's 'eval') and primitives as first-class objects (a la Smalltalk) would be pretty cool.

This article on an imaginary 'Java 3' also makes for an interesting read.


3:45:06 PM      comment []

  21 September 2002

Tara Sue for Congress: A fascinating read. One sharp cookie, with a refreshing take on the world of American internal politics.

9:59:09 AM      comment []

  20 September 2002

BCEL. A tool to build classes on the fly and output them as bytecode. Complex stuff. Luckily it comes with BCELifier. This tool can take an existing .class file and generate the BCEL java source code to build that class. Very cool.

What this means is that if (like me) you find BCEL itself a mite tricky, you can write your class in the normal way, compile it, BCELify it and end up with the source code you need to feed BCEL with to get the same result. Groovy. This reminds me of my dim past, recording VBA macros in Excel to find out how to do something, then hacking the generated code into what I wanted.


2:20:14 PM      comment []

  19 September 2002

Withdrawal symptoms

I'm suffering from a lack of automated refactoring. .Net MockMaker kind of works, but I'm seriously missing IDEA. I'm also still on a learning curve with C# and it gets tiring after a while. Time to play with some Java projects.


5:25:38 PM      comment []

  18 September 2002

Been busy hacking .net MockMaker again today. Its messy at the moment, and there are no real tests (gasp!) yet but I think most of the guts is there. It won't deal with overloaded methods or parameter modifiers yet. I have to learn how they work first :)

Modularising and unit testing tomorrow, unless I get bored of C# and do some Java instead.


5:34:12 PM      comment []

Free Open Source Kills Markets.

Free Open Source Kills Markets

Open source, as a meme, is a successful one. It is also a confusing one because open source often means free software. I am for open source, but I am against wholesale adoption of free software because I believe it harms the health of software industry.

Free open source software devalue commercial software and poisons the marketplace. If some talented individual started giving out free Microsoft Word clone with source code, not only will Microsoft stock drop by 25%, entire word processing market will disappear. Once buys starts thinking that something should be free, there is no turning back.

One might argue that adding new features could revive markets decimated by free software. New features has leverage only during early half of a product category's lifecycle. Word processing market is already well past the halfway point. I measure halfway point as the point where 20% of product feature set meets 80% of user's needs. Past that point, users start caring less about new features.

[Don Park's Blog]

If its possible for a talented individual working in their own time to produce a viable free alternative to a commercial product, doesn't that offer some indicatation as the the true value of that product? If I can get a free Word clone from the net (and I can) instead of paying 100 pounds for Word, then chances are I will. If however, Word had sufficient added value in terms of reliability, ease of use, extra (useful) features, and good quality support to justify the price differential, then I might choose Word. The key issue is that the choice is mine to make. Competition, whether from Open Source or commercial products is a good thing.

If a commercial product is in competition with a cheaper commercial product, it must have sufficient added value over and above the lower cost alternative to remain competitive. Competing with Open Source is merely a more polarised example of the same issue.


5:19:29 PM      comment []

  17 September 2002

Kicked off .NET MockMaker today. It doesn't do much at the moment, and I'm having lots of fun typing things like:
new CodePropertySetValueReferenceExpression();
with no code-completion.

4:50:58 PM      comment []

  16 September 2002

AOP, aka multiple inheritance?

Rickard's recent descriptions of his activities in AOP have been very interesting. From my (probably flawed) understanding, it seems that the runtime behaviour extension framework he talks about bears a striking resemblance to an implementation of multiple inheritance. Even more cool than that, a dynamic, runtime adjustable form of multiple inheritance.

We like that.

In an alternative view, it almost resembles a return to modular, function based programming, where cross-cutting behaviour (such as logging) is encapsulated in a single location, and applied everywhere the application requires it. Interesting.


7:56:52 PM      comment []

  15 September 2002

What I'd really like to attempt is a port of MockMaker to .Net. That would be interesting.

One thing I've noticed is that porting heavily test-covered code is incredibly easy. It helps that C# resembles Java's long lost twin brother in many ways. What's really good is that the test code can generally be copied almost verbatim as it tends to be quite simple, and it lets me drive the production code into existence in the .Net idiom, as I'm duplicating the intent rather than simply pasting Java into C# and fixing all the syntax errors.


11:15:18 PM      comment []

Woohoo, two weeks off. What will I be doing? Probably sitting behind a keyboard coding :) Sort of an open source busman's holiday. When I'm not slumped on the sofa that is.

Started contributing to the .Net MockObjects project this weekend. It's still in the early stages but the fundamentals are there. I can't take any credit for that, Griffin has gotten off to a great start. All I've really done so far is convert the unit tests to NUnit 2.0. Watch this space though.


5:59:20 PM      comment []

  14 September 2002

'The Color of Our Bike Shed'. I've only just started getting involved in open source, so this was an education to me.[transMorphic]

Ditto. All-round good practice for anyone on a mailing list.


3:11:28 PM      comment []

  13 September 2002

Following on from where sleep interrupted me...

Having thought about it some more, I'm not sure a dynamic proxy would be needed in this case.  If the app. container wrapped the component object inside a simple non-dynamic decorator object and handed that to anything that needed it, swapping the implementation could still be done on the fly just by changing the decorator's reference to the implementation.  Wouldn't be as cool though :)


7:16:05 AM      comment []

JMX and dynamic proxies.  This could be interesting.  One of the things I'm not fully up to speed on with JMX is how you actually interact with the MBeans.  Having managed, pluggable components is great, but my POJOs (plain old java objects) still need to access the things, and having the entire API exposed in the management interface sucks.  I'm having the seed of an idea, but can't quite verbalise it yet (not at my best at half-midnight).

Let's see.  Wrap the component in an MBean, and expose its management properties.  Fine.  Register the MBean in the server.  Expose a management operation that returns the implementation of your component.  (This is where it gets sketchy).  Place the implementation inside a dynamic proxy, and have the application container pass the proxy to any objects that need the component (inversion of control).  Do something with notifications so that the implementation object or app. server itself can be called back whenever a managed property is altered.  Retrieve the new component instance from the JMX server and place that inside the dynamic proxy, replacing the old one.  Any clients that have a reference to the proxy instance should now be calling the new component.  Hot swapping.  Hot damn.

Am I making any sense?


12:48:39 AM      comment []

  12 September 2002

Eclipse - thought I'd give it bit more of a test drive. Its been fine, apart from its wierd insistence that non-project source files have to be in jars. Why can't I just point it at a directory? And its hugely annoying that you can't apparently specify a project source code directory outside of your project path. My opinion currently is that the SWT widgets make it look nicer than IDEA, but it has a way to go in ease of use terms. Oh yeah, and it deleted a whole bunch of property files in my classes directory without telling me it would, which was nice. [Pushing the envelope]

In wonder what really does make it look nicer than IDEA? [Begblog]


On further reflection, its not so much that it looks nicer, as more 'native'. Swing apps. can look slightly cartoonish. IDEA isn't one of them thankfully. Maybe I just fear change :)

Don't worry about me switching just yet - IDEA has pretty much become an extension of my hands!

2:12:35 PM      comment []

  11 September 2002

While playing with Webwork and the JMX-RI it occurred to me to wonder what webwork would look like if it was JMX-ified.  If the action mappings were exposed as managed properties, would it be possible to re-configure the workflow of your webapp on the fly via a browser?  Hmm.  That could be fun.  What about using JMX notifications to make WW reconfigure itself in response to network events?  (Like putting a 'we're sorry' message over a bit of the app. if a db goes down, then automagically re-enabling it when it's back up).  Is this even remotely possible we ask?

If nothing else attempting to find out should improve my understanding of both WW and JMX.


6:22:37 PM      comment []

Its been a morning of issues so far:

Eclipse - thought I'd give it bit more of a test drive. Its been fine, apart from its wierd insistence that non-project source files have to be in jars. Why can't I just point it at a directory? And its hugely annoying that you can't apparently specify a project source code directory outside of your project path. My opinion currently is that the SWT widgets make it look nicer than IDEA, but it has a way to go in ease of use terms. Oh yeah, and it deleted a whole bunch of property files in my classes directory without telling me it would, which was nice.

Webwork - A bit fiddly to get started with. The skeleton app didn't work initially, it was looking for an 'xhtml' directory that wasn't there. I eventually found it in the examples folder, and copied it to the webapp, whereupon it worked fine. From what I've seen so far in my dabbles it looks like there is a lot of good stuff here though.


1:26:46 PM      comment []

  10 September 2002

WebWrock!

Test first web-apps… once again… wooohooo![Joe's Jelly]

Superb. Now all I need is a handy project to use WW on. I feel tempted to write a blogging app. and see how many open source frameworks I can shoehorn into it! Oh, and it'll need to be scriptable with Scheme, my current 'just for fun' language :)


6:02:11 PM      comment []

Bruce Perens, Open Source evangelist has put together a website countering the Microsoft-affiliated 'Software Choice' (aka. choose us) site.

Bruce's site: http://sincerechoice.org/

The other one: http://www.softwarechoice.org/

11:05:01 AM      comment []

  08 September 2002

Even though I did go through the steps to get the latest Windows Update stuff (SP3 and IE6) I'm actually using this as an opportunity to wean myself off of Microsoft entirely. I'm keeping strict track of the apps I'm installing and only using the apps that I really, really need. OpenOffice is now the only version of Office on my computer. It's been there, but I've always gone back to the old one. By keeping track of which apps I really need and use that are Windows specific, I'll be able to eventually move to Linux as my main OS and use a bare-bones Win2k install using VMware for those other apps. Now that I've got all the cruft off my system, it's nice to see clearly what I need and what I don't (Macromedia stuff mostly).

Man, I'm almost Microsoft free... I actually don't mind Win2k all that much. It's not horrible. But this is not my OS of the future - I'll never upgrade to XP or beyond because of Microsoft's ever-wackier licenses. A Unix variant will be my future, whether it's OSX or Linux (the later being because I can't afford the former). So I'm doing what I need to now to be able to interopt with the world. I really can't wait for RedHat 8... I think that may be the OS I finally switch to on this machine.

-Russ [Russell Beattie Notebook]

I hope you succeed. I went dual-boot FreeBSD/Win98 on my old pc in an attempt to accomplish the same thing. Not the most pragmatic move, as there has been something of a delay getting OpenOffice ported to FreeBSD, and the Java support is a way behind Linux. Sometimes my hacker-nature desire for the 'best' technical solution is at odds with my pragmatic 'whatever I need to get stuff done' side. Now I'm hooked on FreeBSD - for some reason I found it an easier learning experience than the two times I played with Linux. This makes me wish I had the time/knowledge/ability/influence to bring the Java support up to the levels of Linux. OpenOffice is just about there, which will be great, although I can't fully ditch MS Office until clients stop requiring documents in Word format - OO's conversion is good, but not perfect, and sometimes there's no alternative than to tweak things in MS Word before sending them. There is definitely scope for a standard file format - OO's one has to be a contender. Its files are essentially zipped directories containing XML documents. Plain text - it just makes so much more sense than proprietary (or even open) binary formats for document interchange, now that file size is much less of an issue than it used to be (says the man with a 120 gig hard disk). Zipped XML data sometimes even ends up smaller than the equivalent Word file.


12:40:08 PM      comment []

  06 September 2002

Quite an illuminating FAQ of some of C#'s new features.

http://www.geocities.com/csharpfaq/


1:51:26 PM      comment []

Never write code again!

This topic seems to crop up every 3 years or so, with reliable regularity. Some company proclaims that writing code is dead, their fantastic new tool will do it all for you. Just tell it what you want by point-n-clicking / writing a spec in plain english / beaming it directly from your brain and it will mystically produce your application, exactly how you wanted it!. Hah. I think one of the earliest one of these appeared some time around 1983. Apparently we've all been wasting our time writing code for the last 20 years. The fact that this time its Sun doing it might make it a bit more interesting, but not by much.

http://research.sun.com/features/ace/index.html


1:48:17 PM      comment []

  05 September 2002

The java.nio stuff looks good.  The non-blocking sockets classes especially.  It looks similar in operation to the C 'select' function.  Wonder how long before some of the app. server products make use of it.  It will be interesting to see how much of a performance benefit there is compared to all the clever multi-threaded connection handling architectures that have evolved in the meantime.

Read more at:

http://www.onjava.com/pub/a/onjava/2002/09/04/nio.html


8:52:47 PM      comment []

SPAM.  Sigh.  It won't even start to get fixed until SMTP servers have a mechanism to athenticate each other (callback with a digest etc). [Part of the problem.....]

Paul Graham has been looking into this very subject, with an interesting approach:

http://www.paulgraham.com/spam.html.

Bayesian filtering, cool - I should have paid more attention in stats classes.


8:32:36 PM      comment []

  04 September 2002

I've been mulling the move over to John Companies Hosting for a while. Check it out and you'll see why. Part of the reason I hadn't is because I don't know FreeBSD from my ass. Linux and Unix in general yes, but BSD I have no idea about the specifics. I would need to set everything up myself which is an effort and a maintainence nightmare, but then again I would have MORE CONTROL. (Hmmm. I just checked... they have a Linux server "coming soon" for $10 more than their standard FreeBSD... hmmmm, maybe I'll wait...) FreeBSD is supposed to more mature and stable than Linux. Yahoo, famously, runs on it, so maybe I should do it just for the learning experience. [Russell Beattie Notebook]

If you know Linux, FreeBSD should be simple to pick up. I use FreeBSD at home for all the things I don't need windows for: my CVS repository, email, web surfing, mucking about with perl, python, scheme etc. I prefer it to Linux - it seems more solid somehow. The filesystem layout tends to be more consistent too, mostly due to the packages/ports collection mechanism. I haven't taken the plunge with Java on it yet though.

Useful links:

The FreeBSD handbook

Freshports.org


3:28:16 PM      comment []

  03 September 2002

Cool technologies:

JMX looks like a brilliant way to handle application deployment and configuration. Most articles seem to be concentrating on how it could be used for pluggable framework configuration, such as cache management, database access etc. I think it looks like a fantastic way to allow hot-configuration of running applications without resorting to the usual property file hacking. Just wrap your application in an MBean exposing the configuration properties (database URL, resource locations etc), and it becomes trivial to stick a web interface on the front and reconfigure on the fly, or programmatically in response to events. It shouldn't be too hard to implement clustering as well, so changing the settings of one server in a farm propagates to all of them. JBoss are quite far ahead with this line of thought, it seems - their clustering stuff looks very interesting.

Related links:

JBossMX

A ServerSide article on JMX

Javagroups is a cool multicast framework (used by JBoss's clustering mechanism).


3:06:19 PM      comment []

  02 September 2002

Had a reasonably nerdish weekend. Got TortoiseCVS on my WinXP box talking to my CVS repository on my FreeBSD box, which required sorting out static IP addresses on my two-node home network. All of which was accomplished without fuss on BSD, and multiple reboots on WinXP. Score one to the free OS.

Finally got around to reading The Pragmatic Programmer, after over a year of meaning to.

Played about a bit with Scheme. It appeals to my penchant for writing recursive code.

Realised that there are so many things I want to do at the moment that I'll need to take a vacation from work to achieve them all. Then I'll probably have to take a vacation from my vacation to recover.


2:57:46 PM      comment []

  01 September 2002

Software as cudgel...

Just finished watching a DVD, and made the mistake of letting it run on into the copyright messages in 20 or so languages that have the effect of rendering every control except the 'off' button ineffective.  This goes so against the grain.  Software is supposed to be a tool, not an instrument of control for some corporation to impose their will over that of the individual.  This appears to be increasingly prevalent though.  'Digital Rights Management' - whose rights?  And why do they need managing?  If I buy a DVD, I should have the right to skip through bits I don't want to watch, not have it hijack my player.  Copyright is being taken to utterly absurd extremes, and software is being used as the instrument of enforcement.  As a consumer I feel insulted.  As a developer, I feel ashamed.


3:53:10 PM      comment []

© Copyright 2003 Darren Hobbs