An interesting question came up on the Smalltalk IRC channel. Say I create a class that I want to use as a model for something in a database. Say the database columns start with capital letters, and I want my accessors and mutators to match those names. If you define the class using the class creation tool, it will force the first letter of each of those methods to lower case - not what you want. You don't want to create all those methods by hand, so what do you do?
Well, out of the mists of old muscle memory I recalled class CodingAssistant. Before the RB was integrated, it was a tool that I had added into the browser's menu, so that I could easily generate those methods. It comes in with the UIPainter parcel, so just load that, and then open the tool this way:
Tools.CodingAssistant open
Then enter your class name, select the variables to generate code for, and you're done.
Technorati Tags:
smalltalk