Simberon Design Minute
 

Bending Metal

I was talking to a co-worker about one of the features I'm currently developing in our product. The client wants the ability to enter and edit notes in a rich text format using bold, italic, underline, colored text, and different fonts and font sizes. The resulting text is to be stored as HTML in the database. Smalltalk doesn't really support this kind of thing well in a Windows GUI application. Since our product is always deployed on a Windows platform, my approach was to embed Internet Explorer as an OLE control and use a JavaScript editor. This instantly gives us access to all the rich text rendering and editing features available in a web application without having to write it all ourselves. Interfacing to it, however, is a pain since we have to make our application look like a web application. My colleague commented that it was like trying to bend metal - a reference to Futurama. When you do have to bend metal, you should follow a few principles. First, hide all the bending as much as possible. Make everything look normal on the outside and hide the complicated stuff inside. Second, document how the internals work in case anyone else ever needs to change it. Finally, make the code as simple as possible - a good rule to follow in general.

Download