'''[http://en.wikipedia.org/wiki/Object-oriented_programming%|%object-oriented programming%|%]''' [APN]: For the benefit of newcomers to Tcl who might get confused by the large number of OO extension, the [TclOO] framework is part of the Tcl core language as of version 8.6. It is also available as an extension for 8.5. The list of extensions discussed in this page were created in earlier versions where Tcl lacked a built-in OO facility. The most notable of these, which still have relevance because of widespread use and features, are [incr Tcl] (now built on top of [TclOO]), [Snit] (because of its excellent support for Tk megawidgets) and [XOTcl] (which continues to add leading edge oo capabilities). The rest IMHO are useful only if you are stuck with older versions of Tcl and only of historical interest otherwise. <
> ''I'm not against types, but I don't know of any type systems that aren't a complete pain, so I still like dynamic typing.'': -- [http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en%|%Alan Kay] ,2003 <
> ''Object-oriented analysis and design's underlying concept is that one should model software systems as collections of cooperating objects, treating individual objects as instances of a class within a hierarchy of classes.'': -- Grady Booch <
> ''I invented the term object oriented, and I can tell you that C++ wasn't what I had in mind.'': -- [http://en.wikiquote.org/wiki/Alan_Kay%|%Alan Kay] <
> ** See Also ** [oo]: a page that should probably be folded into this one [ootcl]: a page that should probably be folded into this one [Object vs. Megawidget]: [advantages and disadvantages of oop]: [a case for oo in the core]: [Writing Extensions]: [A simple comparison of Tcl object extensions]: [On things]: a thought experiment [Doing things]: [Toasters and things]: [Chaining Things] ,[MS]: inspired by [RS]' "Things" writings [Doing things in namespaces]: based on [Doing Things] [playing OO] ,by [RS]: [playing oo design] ,by [RS]: [Meta-object protocol]: [oo killed my brother]: a facetious commentary [oo libraries]: a mostly-historical, somewhat philosophical discussion [oo2] and [http://people.manchester.ac.uk/~zzcgudf/tcl/oo3.tcl%|%oo3] ,by [DKF]: precursors to [TclOO] [Simple Closures and Objects]: [thoughts on implementing oo in tcl] ,by [MS]: [thoughts on namespaces and oo]: [thoughts on oo, natural language, human thinking]: [Playing with Circuits] ,by [RS]: how OO can be a ''stylistic'' matter, with'''out''' syntactic scaffolding. [skeleton oo] by [RS]: a template to roll your own object system [oo system for tcl9]: circa 1991 [http://phaseit.net/claird/comp.lang.tcl/ootcl.html%|%Cameron Laird's personal notes on object-oriented Tcl]: historical ** [TIP]s ** [http://tip.tcl.tk/6%|%6]: rejected [http://tip.tcl.tk/50%|%50]: implemented in 8.6, on top of [TclOO]. Historical: [Integrating Itcl into the Tcl core] [http://tip.tcl.tk/257%|%257]: describes what later became known as [TclOO] [http://tip.tcl.tk/279%|%279]: was not completed, whereas 257 was. ** Reading ** [http://www.gener8.be/site/articles/tcl_objects/tcl_objects.html%|%Objects in Tcl], [Koen Van Damme]: a guided tour of creating pure-Tcl objects without inheritance. [http://web.archive.org/web/20071017181547/http://www.unixreview.com/documents/s=9233/ur0407k/ur0407k.html%|%Object-Oriented Tcl] ,[Cameron Laird] and Kathryn Soraiz ,2004-07: [APN] This article is hopelessly out of date. ** General Reading ** [http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en%|%Dr. Alan Kay on the Meaning of “Object-Oriented Programming”], an correspondance with Stefan Ram 2003: ** Description ** The main genres of object-orientation are: class-based: provides mechanisms to to define my a hierarchy of classes (inheritance), classes define classes that in turn define the data and behaviour of instances, and some mechanism for separating interface and implementation prototype-based: objects are dynimcally derived from other objects, with a small number of axiomatic objects provided by the system to cap things off. ---- Tcl appears ambivalent, at best, about object orientation. [Darren New] has suggested that "the need for OO techniques is greatly reduced by a language with [eval] and [info] and dynamically-sized structures built in." [DKF] finds subclassing for GUI configuration suboptimal. ** Benchmarks ** [Comparing Performance of Tcl OO extensions]: [Object Instantiation Test]: implementation of the object instantiation benchmark of [Tcl OO Bench] in some OO extensions of Tcl. [tcl oo bench]: comparison of OO extensions of Tcl is based on OO benchmarks of Doug Bagley's [http://www.bagley.org/~doug/shootout/%|%OO shootout], which includes '''Object Instantiation''' and '''Method Calls'''. [oo method calls]: implementation of the method invocation benchmark of [Tcl OO Bench] in various Tcl OO extensions ** Tools ** [objectwalker]: intended to be generic enough to use with various Tcl OO packages ** Languages ** A list of object-oriented languages that have had some influence on Tcl or packages for Tcl. [SELF]: based on [SmallTalk], but more flexible and powerful, and probably even more pure [SmallTalk]: ** Discussion ** [DKF]: Fundamentally, '''OO in Tcl''' means that you've got an [ensemble]-like command (i.e. a command with subcommands) and some internal state model associated with that command (and manipulated by the subcommands) that goes away when the object is destroyed. That's all that's ''required''. Everything else (including classes) is optional, if often useful to have. Note that according to this definition, Tk uses an object system for its widgets. [wdb]: The benefit of object orientation is doubtlessly its information-saving and hiding capability. Possibly oo is mainstream nowadays. If a language is purely object-oriented such as [Ruby], then it is ok. But oo is '''not''' the one true solution. If a language has a different paradigma such as [Tcl] and others, then it's nice to have the opportunity to use oo, but not to forget that there are other mechanisms of information hiding. I have used both, [Itcl] and [Snit], and both do a good job in their way, but in some cases I prefer more language-generic mechanisms such as procedures originated in namespaces where they have ''private information'' as well. The true benefit of Tcl is imho the opportunity to use more than one oo extension in one application. This makes Tcl unique compared with the other scripting languages. ** Brief List of Popular OO Frameworks for Tcl ** Since the comprehensive list (below) has grown very long, here is a short list (in no particular order) of some OO frameworks that are in very widespread use. [TclOO]: Distributed with Tcl 8.6 and higher, and also available for Tcl 8.5. Designed as a platform for building object systems, but all usable as an object system in its own right. [Snit's not incr Tcl] (Snit): relies on delegation rather than inheritance. Pure Tcl package, bundled with [Tcllib], [ActiveTcl] [incr Tcl], or '''itcl''': binary package, bundled with [ActiveTcl] and also built into [Tclkit]. [incr Tk] and [Iwidgets] use '''incr Tcl''' [XOTcl]: binary package, bundled with [ActiveTcl] [ClassyTcl]: binary package. [ClassyTk] uses '''ClassyTcl''' [stooop]: pure Tcl package, bundled with [Tcllib], [ActiveTcl]. Close to [C++] in design ** Comprehensive List of OO Frameworks for Tcl ** Some of these frameworks are intended for general-purpose deployment; others were developed to satisfy the requirements of a specific project. Some of these frameworks are no longer maintained. [Category Object Orientation] lists several other projects that use a minimum of code to provide a subset of object-oriented facilities. *** Class-Based *** [AXL]: syntax quite similar to itcl [BOOP] (Basic OOP) ,by [JohnBuckman%|%John Buckman]: less than 100 lines, super-simple, aimed at people who want a small amount of object-oriented functionality (objects, member functions, memory cleanup, member vars) implemented in simple, comprehensible Tcl that won't gum up your environment, complexify your debugging or break debuggers. [CASTE]: based on Common Lisp Object System (CLOS) [ClassyTcl]: Tcl and C based versions available [dkfobj]: a predecessor of [oo2] [Dyso object system]: deprecated for [Odys object system]: [EGR MAF]: multimeda applications framework, includes C++ and Tcl bindings [ical oo]: circa 1993 [incr Tcl]: one of the most popular object systems for Tcl [jTcl Java-like object interface to Tcl]: [MeToo], or '''M'''eToo '''e'''mulates '''T'''cl'''OO''' ,by [APN]: a (small) subset of 8.6 core's TclOO in pure Tcl [mkextensions]: includes '''mkClasses''', a Tcl object class and methods mechanism [MIT otcl]: dynamic Object-Oriented Programming extension for Tcl, featuring program styles, inheritance, meta objects, automatic method combinations, mixing of C and C++ [MIT otcl megawidget system]: [http://pdt.github.io/nso%|%NSO] ,by [pdt]: Simple object system with single inheritance, tagging, forwarding, getters/setters, support for class libraries. [Object Tcl]: A Tcl extension that allows one to use object oriented programming concepts from within Tcl and provides a tight object-oriented coupling to C++. [Object Tcl by Nagao Shijo]: [Oblets] ,by [Koen Van Damme]: yet another very simple object system for Tcl [obstcl]: Small Tcl object system package [obTcl]: A Tcl 7.[[45]] object and megawidget extension, supporting multiple inheritance, three new storage classes, and fully transparent Tk megawidgets. [Odys object system]: [OO by dejong]: OO extension that works in Tcl 7, Tcl 8, and Jacl [Pool (Kupries)]: yet another OO Tcl-based system [scwoop]: Simple Composite Widget Object Oriented Pacakge [http://groups.google.com/d/msg/comp.lang.tcl/O3mLW4kSxOo/ejRnaKHZaagJ%|%Something cute and fuzzy] ,[Mike Rogers] ,2001: a [pure-Tcl] [extension] that endows [namespace]s with [inheritance]. [Snit's Not Incr Tcl]: a pure-Tcl object framework which relies on object composition and delegation rather than object inheritance [sntl]: Sam's (Non-Standard) Tcl Library [STERNO]: Simple Tcl Extra Really Nice Objects [stooop]: part of [tcllib]. Provides commands to extend Tcl in an object oriented manner. Meant to be as simple to use as possible. [TAO], or [TCL Architecture of Objects] ,by [Hypnotoad]: Could be described as yet another object system for TCL, but in reality it is a methodology for open ended program design, and code re-use. Uses [sqlite] for metadata storage. [Tcl++] ,by [Matt Newman]: A pure Tcl implementation of incr Tcl. [Tcl_OO] by [Joe Mistachkin]: [Tclpp]: Tcl 8 based object oriented extension. Provides Java or C++ object syntax to Tcl. Adds items like multiple inheritance, data encapsulation, virtual functions and RTTI (Run Time Type Info) [Iliadtool2 Tea]: Follows the Java model, trying to implement the look of Java from a class definition perspective, yet remain syntactically consistent with Tcl. [tiny oo with jim] ,by [RS]: [TODL]: An easy way to build Tcl objects (to be used as an educational aid rather than a development tool) [Transparent OO for Tcl], or [TOOT], by [NEM]: unifies Tcl's traditional first-class [transparent] values (like string, lists, and dicts), with the [handle]-based OO types. [xoins]: An [XoTcl] class that emulates [snit] [XOTcl]: A value-added replacement for the [MIT] [OTcl] object system. Flexible, with mixins, filters, multiple-inheritance, and more. One of the more popular object systems for Tcl. *** Prototype-Based *** [Selfish] ,by [Setok]: [another minimal tcl object system (XOTcl like syntax)]: [BOS]: [dicthash: Yet another lightweight object system]: [Poet]: Prototype Object Extension for Tcl. Features prototype-based inheritance, constrainst, and persistence. [Prototype Pattern in Tcl]: includes a short and sweet [TclOO] implementation of Steve Yegge's Prototype Pattern [Snit's Not Incr Tcl]: a pure-Tcl object framework which relies on object composition and delegation rather than object inheritance [framesets]: Frameset based OO implemention for Tcl. [theObjects]: Small prototype-oriented object system. [Yet another object system]: does everything with lists. [SDynObject]: a pure Tcl system that is very simple and extensible. [Procs as objects]: does it with default arguments to procs, instance variables might be kept in alias only. [TOE]: an extension to the Tcl programming language that enables object-oriented (OO) programming in a class-based, Java-like style. Toe provides commands that allow a Tcl scripting programmer to create OO classes, define functional relationships between classes, run Tcl code in objects created from the classes, and implement various multiple-class patterns that are well-known in the object-oriented paradigm. [TWO]: Tcl With Objects. Author wrote it because I felt that existing object extensions to TCL either were so complex they were difficult to port and to debug, or they made member variable access unnecessarily complex [ycl%|%ycl::context] ,by [PYK]: features cascading variable and command access. [ycl%|%ycl::ns::object] ,by [PYK]: like [ycl%|%ycl::context], but implemented in less code, taking advantage of the nuances namespace functionality. Cascading variable and command access. Methods are subcommands of a namespace ensemble, and use [info level 0] to bind to an object when called. Upmethods bind to an object by using [upvar 1...], and [upvar 2...] is the caller of the method. [UFO (yet another pure tcl OOS)] ,by [MS]: an unfriendly [[sic] but powerful prototype-based object system *** Aspect-Oriented *** [tclaop]: Aspect Oriented Programming extension (experimental). Based on the good work of stefan Sinninge Tclpp (version 1.2, pure tcl script). ** Minimal Object ** The following systems are novel, and marked by the lack of a mechanism to create objects that are based on other objects or classes. [Gadgets]: a minimal pure-Tcl OO system that allows (but not requires) to distinguish objects and classes. poor-man's objects, a variable-proc pair that is renamed away when the string dies [LOST]: OOP that can be easily distributed across a network using [jcw]'s [Tequila]. Inspired by [Gadgets]. [MOST]: Like [LSOT], but keeps data in arrays [Thingy: a one-liner OO system]: although there is a procedure on the page for copying thingies. ** Radical Experiments ** [Yet another object system] ,by [jcw]: [EIAS%|%Everything is a String]! ** Half-Bakery ** Ideas that did not come to fruition [UPL: Command-Oriented & Object-Oriented Tcl/2]: *** Unsorted *** What: this Where: From the contact Description: An easy way to build Tcl objects. Contact: mailto:cball@etsd.ml.com (Charles Ballance) What: TOS Where: http://www2.lifl.fr/%7Epawlak/tos Description: Tcl Object System (TOS) is another Tcl extension for object oriented programming, this one having full reflectiveness. Contains special objects called Class, Metaclass, and Object that control the base object behavior and devinitions. Currently at version 2.3.1 . Updated: 11/2006 Contact: mailto:pawlak@cnam.fr (Renaud Pawlak) <> Concept | Object Orientation | Arts and crafts of Tcl-Tk programming