Monday, February 23, 2004

LambdaMOO

During the past week I rediscovered my enjoyment of LambdaMOO. Porting to Cygwin was straight-forward, and cygrunsrv makes it a snap to run a MOO on my laptop as a service (I'm using JHCore). I've not programmed an object in ages, but it'll be a relaxing task to take up when I'm back in the hotel needing a break from client code. I'm looking forward to making a duck.

Immortality at a price

A nice article in the current Overload (issue 59, February 2004) on the bogosity of garbage collection in Java. Memory is just one resource; the lack of destructors in Java is a large hurdle to managing other resources such as network and database connections. And finalize() is just plain broken. All is not lost, but there's more work to managing resources (including memory) than just "code and forget", the most common practice I see in Java.

Tuesday, February 17, 2004

The next project

The next J2EE which comes around, I am definitely looking hard into an alternative to Struts and JSPs. Reasonable alternatives (to read the accounts of others) seem to exist such as WebWork and Velocity. Getting away from compiling JSPs and the difficulty of maintaining a Struts/Tiles configuration (althought @xdoclet does help) will be worth the transistion costs.

Monday, February 09, 2004

Good programming day

I must have coded around -600 LOC today. A good day, to be sure.

The right way to sell software

<1060> Research sells software the right way: open-source if you are open-source, commercial if you are commercial, fixed-rate schedules. Beautiful! It feeds the open-source world and encourages novel uses, it feeds the developers and keeps the revenues coming, it removes the risk of negotiating the wrong price. I wish more companies understood all of this. I quote from the products page:

Licenses

NetKernel may be used at no charge under an obligatory open source model, see license - this license requires that all applications developed and executed on 1060 NetKernel be released as open-source. We offer commercial licenses that permit the use of closed source applications. Commercial licenses start from 450 UKP.

Please contact license@1060research.com for commercial licensing terms.

1060 NetKernel embeddable REST microkernel

The 1060 NetKernel microkernel is suitable as an embeddable Internet server. We are happy to offer embedded licensing terms and to customize bespoke system configurations for embedded systems.

Please contact sales@1060research.com to discuss your requirements.

Support

We offer a flexible selection of support options which range from one-off packages ideal for installation/getting-started assistance through to multiple incident packages suitable for production applications.

All support tiers include a dedicated support email address direct to the 1060 NetKernel development team and dedicated support telephone number. For ongoing support incidents we can provide direct email-to-SMS to a support contact.

TierPriority UnitsSupport HoursPrice
Install11350 UKP
Bronze24950 UKP
Silver4162950 UKP
Gold8404950 UKP

Support usage is calculated from a combination of Priority Units and Support Hours as follows

  • A Priority Unit is a single support incident requiring a guaranteed 48hr response. The response will give an analysis of the issue and all reasonable efforts to provide a fix. Time taken solving the issue will be debited from the support hours credits.
  • Any number of non-urgent support requests may be raised. A first response is guaranteed within 5 working days and demand permitting we endeavour to provide a more rapid turnaround. The time required to handle a support request will be debited from the support time allocation. Support hours may be used in any way you wish,for example you could ask our developers a specific question, get assistance architecting solutions, have our developers debug your code or even ask a developer to produce custom code. For larger projects or custom solutions you may prefer to contract with our professional services team.
Notes:
  • Code developed as part of a support package will be open-sourced. To have our developers work on closed source you may require a commercial 1060 NetKernel license.
  • Telephone support may be directed to voicemail during non-office hours. Voicemail is checked at regular intervals.

Please contact sales@1060research.com to purchase support packages.

For Jetty specific support please contact our friends at Mortbay.

Thursday, February 05, 2004

Wednesday, February 04, 2004

The web in Java

An interesting project on SourceForge: JXWB and WWE. WWE is an HTML4/CSS2-compliant HTML renderer kit for Java. The description of WWE:

This is the final release of WWE 1.0. It is an implementation of an HTML editor pane and kit providing Java Swing developers with an HTML renderer/editor that supports W3C's latest specifications for HTML and CSS. This release is slightly premature in that it has been repackaged from a commerical project and as such isn't as clean as can be expected. Another release will be forth coming addressing this issue as well as providing documentation.

Found here.

Tuesday, February 03, 2004

WARS pattern

The guys at Shocks have an interesting article: The WARS Architectural Style. In my current project we wind up doing something that is not horribly far away, but is much more informed by the Service Locator model.

Friday, January 30, 2004

Optimization: Your Worst Enemy

Nail-Tinted Glasses notes this amusing essay on optimization from someone who really knows what they are talking about.

Now there's a title to grab your attention! But I'm serious!

First, a little background on me: my PhD was one of the earliest on the automatic creation of optimizing compilers from formal machine descriptions ("Machine-Independent Generation of Optimal Local Code", CMU Computer Science Department, 1975). After my PhD, I spent three years at CMU as a senior researcher on the C.mmp multiprocessor computer system which used our home-grown Hydra operating system, a secure, capability-based operating system. I then went back to compiler research on the PQCC (Production Quality Compiler-Compiler) project, which ultimately led to the formation of Tartan Laboratories (later, just Tartan, and now absorbed by Texas Instruments), a compiler company, where I was part of the tooling group. I spent a decade-and-a-half writing and using performance measurement tooling.

This essay has several parts and represents much of my own experience. The stories I tell are true. The names have not been changed, although a couple are carefully omitted.

Monday, January 26, 2004

Working for the best

I'm pretty happy to be working at ThoughtWorks. One reason is XP. The whole company has taken up the XP mantra and we all happily hum it to ourselves while coding in our sleep. And it gets results. I look forward to seeing the faces of skeptical clients as we present these low defect project cases to them: shock, disbelief, delight.

Sunday, January 25, 2004

Still fresh

I noted before about the changes in the upcoming Python 2.4, which at the time amounted to none :-). But I just checked back and are some now. If I weren't spending so much of my work time immersed in Java idiocies (mixins anyone?), I'd be spending a lot more time promoting Python within ThoughtWorks.

Sunday, January 18, 2004

Cooler iterators

Crazy Bob has some great example code for a neat trick with iterators: using closures (or at least Java's lame, broken attempt at the fundamental notion of a closure). Spiffy!

Bile for test-driven development

BileBlog has a strong rant against test-driven development. I see his point. Personally, I uses a hybrid of TDD and code-first development, depending on what suits my whim. More to the point:

The problem with the TDD crowd is that they're unwelcome guests in a world that doesn't want or care about them. I'm very sick of TDD bigots being snooty, getting offended, and angrily tugging at their unmentionables every time they see a unit test that doesn't meet their ludicrous standards for what constitutes a unit test.

So, let's look at a concrete example. I'd like to test a servlet. The servlet is standalone, it doesn't call anything else, it just Does Stuff. It's a standalone unit for all intents and purposes. There's no webwork, struts, or any such crap involved. I don't want it to be a wrapper with the work done in a POJO. I just want my single damn servlet. Sometimes a servlet is just a servlet.

The TDD asshats will now start furiously chewing on their desks if you try to use any sort of real container in your unit test. To them, that pollutes the test, you're in fact testing the container too and not just your servlet. That, astoundingly, makes it an invalid unit test (or at best, crippled, awkward, unwieldy).

Even more incredible are the suggestions they offer up to overcome this crippling (!) dependency. Suggestions that range from not using a servlet, to using mocks, to getting some POJO's involved, all so that you can have clean unpolluted tests.

To make some of my fellow ThoughtWorkers aghast, I have to agree here with the rant. And he, too, dances the hybrid dance:

I don't write my tests first. I know very few people who do. It's awkward, fragile and unintuitive. For those who enjoy it and find that it's none of those things, great! At best, I'll do a mixture of the two, and have something vaguely functional, then write a testcase and make sure it tests all the conditions I'd like it to pass under even though I know that it'll fail.

The most important thing is not to follow fashion, but do what works for you. Or just Do The Right Thing:

Two famous people, one from MIT and another from Berkeley (but working on Unix) once met to discuss operating system issues. The person from MIT was knowledgeable about ITS (the MIT AI Lab operating system) and had been reading the Unix sources. He was interested in how Unix solved the PC loser-ing problem. The PC loser-ing problem occurs when a user program invokes a system routine to perform a lengthy operation that might have significant state, such as IO buffers. If an interrupt occurs during the operation, the state of the user program must be saved. Because the invocation of the system routine is usually a single instruction, the PC of the user program does not adequately capture the state of the process. The system routine must either back out or press forward. The right thing is to back out and restore the user program PC to the instruction that invoked the system routine so that resumption of the user program after the interrupt, for example, re-enters the system routine. It is called PC loser-ing because the PC is being coerced into loser mode, where loser is the affectionate name for user at MIT.

The MIT guy did not see any code that handled this case and asked the New Jersey guy how the problem was handled. The New Jersey guy said that the Unix folks were aware of the problem, but the solution was for the system routine to always finish, but sometimes an error code would be returned that signaled that the system routine had failed to complete its action. A correct user program, then, had to check the error code to determine whether to simply try the system routine again. The MIT guy did not like this solution because it was not the right thing.

The New Jersey guy said that the Unix solution was right because the design philosophy of Unix was simplicity and that the right thing was too complex. Besides, programmers could easily insert this extra test and loop. The MIT guy pointed out that the implementation was simple but the interface to the functionality was complex. The New Jersey guy said that the right tradeoff has been selected in Unix -- namely, implementation simplicity was more important than interface simplicity.

The MIT guy then muttered that sometimes it takes a tough man to make a tender chicken, but the New Jersey guy didn’t understand (I’m not sure I do either).

Be a tough man. Or not.

Wednesday, January 14, 2004

Making a reuseable tile

After much righteous struggle, my programming pair figured out how to make a reuseable tile for Sruts, testing and all. The pieces are five:

  1. An actual tile (JSP file) and matching entry in the tiles definition file; this is fully reuseable
  2. A controller and display adapter to populate the tile, and tests for the controller; use an abstract base controller and test for the tile and specialize for each specific use
  3. An action and form to read the tile back, and tests for the action; use an abstract base action and test for the tile and specialize for each specific use
  4. Glue in the struts configuration file to hold it all together
  5. And methods in the service layer as data sources and sinks for the controller and action and tests

And all my tests are green.

I plan within the next few days to update Wisk with a demo of this pattern, but first I want to get @struts working — web.xml and taglib.tld but not struts-config.xml. Very odd.

Tuesday, December 30, 2003

The digital security infrastructure

Doc Searls notes a good summary of the state of digital security infrastructure. Some of the flavors he lists I've never even heard of—a nice chance to read something new and different and yet the same old thing.

Sunday, December 28, 2003

Microsoft is dead, long live Microsoft

I've seen Microsoft put the kibosh to its own obit too many times to let myself any longer have hope. Nonetheless, those of you who still think defeating the Eye of Redmond is possible can take heart in this article from The Enquirer. I fear it is more likely to belong in this Enquirer.

Wednesday, December 24, 2003

A great link for automated testing

Manageability has a great list of automated testing tools for Java. If you have a need for this sort of thing (and anyone programming in Java who says they are without a need is pulling your leg), this is the list for you.

JDK 1.5

Are you ready for JDK 1.5? Members of JavaLoby may preview the alpha as long as you follow the stipulations. Sun is looking for feedback. Go forth, and backfeed.

Thursday, December 18, 2003

Careful what you wisk for

The Web Starter Kit (Wisk) project is now open for business on SourceForge. Their are no web pages (yet) but I hope to upload the starting code base into CVS over the weekend.