This is a page for information, tips and hits about the XOTcl object oriented extension.
Partly taken from the XOTcl homepage [L1 ]:
XOTcl combines the ideas of scripting and object-orientation in a way that preserves the benefits of both of them. It is equipped with several new language functionalities that help building and managing complex systems. It supports the following features:
Zoran Vasiljevic describes: "... it runs leak free, does not crash, obeys to what's written in the manual, is thread-safe, can be used under AOLserver or under Tcl threading extension w/o problems, is loaded with features., checked with Purify... ... We have written 100K lines in Xotcl and I find it very valuable. I like it more than incrTcl since it ihas more of the dynamic nature of Tcl than incrTcl does. The incrTcl is more appealing to c++/java programmers. Xotcl should be more appealing to Tcl programmers, IMHO."
XOTcl is thread safe (see Thread-safe Tcl Extensions) and one of the fastest OO Tcl Extensions (see Tcl OO Bench)
Gustaf Neumann GN writes to the XOTcl mailing list [L2 ] on 20Jul03:
...let me re-iterate the basic "philosophical" point of view. Languages like xotcl are object-oriented, while languages like java (and most of UML) is class-oriented.
Class-oriented means: look at the class and you know exactly how all of the instances look alike. The class is the first and primary language construct; the class is well the place where you specify the instance variables (there are no instance variables except those specified in the class). The only kind of individualism left in the objects is to let them differ by their state (the values of their instance variables). Changing classes (class migration) is conceptionally quite hard for this setup.
Object-oriented (in this distinction) means that the primary elements are objects, which keep all instance variables. classes my be used to specify the behavior of objects, they are container for methods and they control the life-cycle of objects. Objects are like the facts, and objects are like rules, that determine the behavior of the objects. Since the connection between objects and classes is rather loose, it is sufficient to define their relation through an association. Therefore it is quite easy to change the relation between objects and classes (and between classes and classes) dynamically. Objects have arbitrary individualism, they may have variables never used in any class, they may have private procs etc.
From the expressiveness, object-oriented languages can - in principle - be restricted to behave like class-oriented languages, but the other way around is much harder.
Useful code tidbits:
See also XotclIDE, XOTcl Documentation Tool, Learning XOTcl, Object Orientation.