Archive for August, 2004

Singleton != Static

Friday, August 27th, 2004

On Cedric’s latest entry he complains about statics, and quite rightly. However, one of the commentators missed the point.

(more…)

Tags:

Unit testing email

Thursday, August 26th, 2004

The JavaMail API is a nice, simple, and effective API. But it’s got one problem: it’s a bugger to unit test. This is mostly because (unlike most other Sun Java APIs) there are no real interfaces in place, which makes it hard to mock pieces out. An excellent solution to this problem is Dumbster

(more…)

Tags: ,

“Pass-the-parcel” exceptions.

Wednesday, August 25th, 2004

Hani makes a surprisingly unbilish point about wrapped exceptions Wrapping already wrapped exceptions isn’t the best idea in the world.

This technique reminds me of the children’s game of “Pass the Parcel”, where you put multiple layers of wrapping on a gift, and the children never know when they will reach the last one.

I’m as guilty of this as the next person, but I think in future I will modify the constructors of my wrapping exceptions so that if a cause already exists, it uses that as the cause, not the one supplied…

(FWIW, I’m not against wrapping exceptions; what is an ObjectNotFound at one layer is a ConfigurationException at another, and should be reflected as such).

This may, of course, just be a stupid idea, but it’s worth exploring.

Tags:

Recognition gap

Monday, August 23rd, 2004

Esther Derby describes a notice from Gallup about the lack of recognition and appreciation in modern companies.

(more…)

Tags: , ,

Don’t Overcomplicate Things

Thursday, August 19th, 2004

A gentle reminder to myself: don’t make things more complicated than they need to be.

(more…)

Tags: ,

Unit testing privates, and other unsavoury topics

Saturday, August 14th, 2004

Brian Duff gives a good example of a technique to get around visibility problems when unit testing. Believe it or not, this can be a good idea (and this is a strong TDD advocate saying this).

(more…)

Tags: ,

Python Paradox makes sense…

Friday, August 13th, 2004

Paul Graham wrote about The Python Paradox. Unlike his earlier talk, this one actually had a good point.

(more…)

Tags: , ,

Why it’s important to be able to unit test outside the container

Sunday, August 8th, 2004

Daniel Steinberg has a “note on Java.Net”:http://weblogs.java.net/pub/wlg/1732 about testing EJBs out of the container, and wonders why people make a fuss about it. There’s a simple reason: speed.

(more…)

Tags: ,