Category Archives: Java

Enforcing acceptable package dependencies in your build 6

Package dependencies in Pasta Today on my current project I had to spend some time creating a client JAR file for use by downstream systems. I needed to keep the JAR as small as possible, with (more importantly) no external JAR dependencies. There are tools out there for dependency analysis, such as IBM’s Structural Analysis [...]

It seems we'll finally be able to calculate free disk space with Java 5

Two of the three bugs on my watch list have in recent days been makred for inclusion in Mustang (Java 6). RFE 4057701 entitled “Need way to find free disk space” has been in since virtually the year dot, and was originally dropped from the first NIO JSR: Resolution of this request is considered a [...]

Ruby on Rails – bridging the gap? 4

When Java first arrived, the initial hype was all about “write once, run anywhere”. It’s language a mess of compromises born out of it’s heritage as a language for embedded machines and a desire to keep C++ programmers happy. Once people got over the novelty of inherently portable code, the attention then fell (initially favourably) [...]

Looking at Context IoC 4

It was with some interest I spotted a positive mention of something called Context IoC (a new type of IoC apparently) on Dion Hinchcliffe’s Blog. The while topic really bores me right now as IoC stopped being something fancy a long time ago, and to me it’s now nothing more than “calling a proper constructor”. [...]

Micro-IoC functionality to be in next Java version 9

Yes, you heard it here first folks, but Sun has finally woken up and decided to include a micro IoC container in the next version of Java! Using a special keyword, the container lets you create an object that can be used straight away, by passing all dependencies in.

Exception handling revisited 2

I like unchecked exceptions. Here’s why – I like to know something went wrong without having to explicitly handle every possible error. I like checked exceptions. Here’s why – when I decide that an error should be handled in my system, I want to force it to be handled as a defensive measure. We can [...]

JMS, transactions and exception handling 7

We’re currently working on a JMS-drived application, which is being used as an integration point between several systems. We’ve defined a standard exception handling process – checked exceptions for those errors that can be handled by the system, unchecked exceptions for those errors that cannot be handled. The unchecked exceptions are all allowed to bubble [...]

Sun on Mustang (J2SE 6.0) – squaring up to .NET? 10

JSR 270 covers the proposal for the J2SE 6.0 release. Unlike most other JSR’s, it is not defining any new API’s, rather it is defining which JSR’s are being considered for inclusion in what will no-doubt be called Java 6. Looking down the list I was struggling to find much on the list I actually [...]

Enforcing test coverage in the build 5

First off, I’d like to say that 100% test coverage does not mean that your code is bug free – it simply means you haven’t written a test good enough to find a bug. Your tests could even cause all of your code to be executed, but not have a single assert anywhere. How much [...]

Changing my JavaBlogs feed 0

A quick post those people reading this site via JavaBlogs. You might like to know that you’ll no longer be receiving my “del.ico.us(My del.icio.us links)”:http://del.icio.us/padark links spliced in with my feed. If you still want to get them, you’ll need to subscribe to my “FeedBurner feed(magpiebrain – summary posts with del.icio.us links spliced in, RSS [...]