Archive for February 2007

Classic Singleton

February 28, 2007

February is nearly out and I haven’t posted for a few weeks so I thought I’d just throw in my thoughts on the use and misuse of Singletons! Many of my colleagues working in Java pepper their code with static methods and use them as placeholders for pure function calls. Some would argue that the language encourages this.

I’ve also seen the same thing in Smalltalk code – since the class side only exists once in the image it is in effect a Singleton and therefore we can use this to our advantage and write class methods to achieve the Singleton effect. So if you want to create a WidgetFactory as a Singleton you can simply add class methods to WidgetFactory that return widgets for you (e.g. #getWidget:). But just because you can doesn’t mean you should!

(more…)

Why Wouldn’t You Use Seaside?

February 7, 2007

I picked up seaside for the first time 2 months ago and having played with the stuff I guess I’m intrigued by the question “why wouldn’t you use seaside?“.

(more…)