Main Content

Object Orientation in Tcl - [incr-Tcl]

Archive - Originally posted on "The Horse's Mouth" - 2005-04-24 10:05:17 - Graham Ellis

For medium sized to huge projects, an Object Oriented approach to programming can pay massive dividends at (perhaps) the initial cost of a longer design phase and class testing.

Tcl is the oldest of the Open Source languages that we offer courses on, and it's a command based language that was written around structured programming techniques. Is it Object Oriented, then? Not as such - although the Tk GUI uses something that's rather akin to an object for each widget.

The [incr-Tcl] extension to Tcl provides a way of adding a true, full OO capability to Tcl. It's automatically provided these days as part of the ActiveState Distribution of Tcl, and it comes with most of the Linux and Unix distributions too. And it's a well implemented OO capability that extends Tk's widget philosophy. It even includes multiple inheritance if you need that sort of complexity.

I've put a short [incr-Tcl] example into our solutions centre ... and articles on other difficult-to-answer questions there and also in the [incr-Tcl] training module examples.

[incr-Tcl] is briefly covered on our Tcl Basics course, and we can provide additional coverage as necessary via Extra days or on private courses