Classic Singleton

Posted February 28, 2007 by objectcentric
Categories: Design Patterns, Objects, Smalltalk

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!

Read the rest of this post »

Why Wouldn’t You Use Seaside?

Posted February 7, 2007 by objectcentric
Categories: Seaside, Smalltalk

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

Read the rest of this post »

Scriptacu-list Tutorial(Part 7)

Posted January 26, 2007 by objectcentric
Categories: Scriptaculous, Seaside, Smalltalk

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.

Read the rest of this post »

Scriptacu-list Tutorial(Part 6)

Posted January 25, 2007 by objectcentric
Categories: Scriptaculous, Seaside, Smalltalk

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.

Read the rest of this post »

Scriptacu-list Tutorial(Part 5)

Posted January 24, 2007 by objectcentric
Categories: Scriptaculous, Seaside, Smalltalk

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!

Read the rest of this post »

Scriptacu-list Tutorial(Part 4)

Posted January 23, 2007 by objectcentric
Categories: Seaside, Smalltalk

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

Read the rest of this post »

Scriptacu-list Tutorial(Part 3)

Posted January 22, 2007 by objectcentric
Categories: Design Patterns, Objects, Seaside, Smalltalk

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…

Read the rest of this post »


Follow

Get every new post delivered to your Inbox.