Archive for the ‘Smalltalk’ category

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!



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?“.


Scriptacu-list Tutorial(Part 7)

January 26, 2007

To complete our application we will allow our users to upload a picture of the contact so that it appears on the details drop down.


Scriptacu-list Tutorial(Part 6)

January 25, 2007

OK if you’ve stuck with me so far you should have a functioning application with a Scriptaculous effect that you have achieved with very few keystrokes (very few indeed if you just copied my code!). We are nearly at the end of our journey – just 2 more sessions to go. So for today’s session we will look at taking that “Toggle Details” link and make it more context sensitive – “Show Details” to show the details and “Hide Details” to hide them.


Scriptacu-list Tutorial(Part 5)

January 24, 2007

Its time to get our little Contact List application into the Web2.0 era by adding a funky Scriptaculous dropdown on our contact list. The really cool thing is that we are going to do all this without writing a single line of Javascript (Lukas Renggli has already done that for us.  Much respect Lukas!) – it’s Smalltalk all the way for us!


Scriptacu-list Tutorial(Part 4)

January 23, 2007

Time’s tight today so I will just introduce my technique for creating alternating rows into our contact list.


Scriptacu-list Tutorial(Part 3)

January 22, 2007

So we’ve got a simple Contact List working but there are two big problems.

  1. When I’m editing the contact the data changes even if I click “Cancel”.
  2. It doesn’t look very pretty.

Today we are going to fix this…