method

Difference between version 6 and 8 - Previous - Next
In [object orientation%|%object-oriented computing], a '''method''' is a
function ([proc]) that is bound to a particular [object] (a [class] or
[instance]).  A method might be bound to an [object]  when the object is
created, or only when the method is invoked (late binding).  The name "method"conveys that the functions provides a way to perform some operation on the
resource that an object encapsulates.  An object should represent the
encapsulated resource, and each method should operate exclusively on theencapsulated resource, not on on resources found in the environment or provided
as arguments.

`method` is a command available inside object definition contexts in various OO extensions:

   * [TclOO]:  `[oo::define]` and `[oo::objdefine]`
   * [ITcl]:  `[itcl::class]`
   * [Snit]:  `widget`, `widgetadaptor`, ...


<<categories>> glossary | object orientation