Meta-object Protocol

A Meta-object Protocol is used in different object-oriented systems to specify behavior of the underlying object system.

See Also

Introspection
A concept similar to reflection.
TIP 177 , Object Type Introspection
A proposal to add a routine that provides information about the internal representation of an object.
TIP 279 , Adding an Extensible Object System to the Core
Discusses various features of a meta-object protocol.

Reading

Meta-Object Protocol links
The Art of the Metaobject Protocol , Gregor Kiczales, Jim des Rivieres, Daniel G. Bobrow ,1991

Other Languages

The following is a list of meta-object protocols for some other languages.

Lisp
Perl 5
Perl6
Smalltalk
also this .

Description

A metaobject protocol is a description of the abstract design of an object system, and of the structure and behaviour of the components of the system. These components are themselves "objects". For example, many systems provide objects called classes and other objects called instances. In some dynamic object systems classes themselves are instances, and they play a particular role of generating other instances.

The term metaobject arose from the need to refer to objects themselves in an object, rather than the things those objects are related to in the data model that a given program operates on. If one consideres the domain of object orientation to be the modeling of a program itself rather than the thing the program models, then these things called "metaobjects", e.g. classes and instances, are simply the "objects" in the program modeal, which is not to be conflated with the date model for the target domain.

A meta-object protocol can also be used in applications where reflection is needed for a system to be able to examine itself:

Designing a Secure and Reconfigurable Meta-Object Protocol , Alexandre Oliva Eduardo Buzato, 1999-02
A Meta-Object Protocol for Distributed OO Applications , Lionel Seinturier et al, 1997 (DOI:10.1109/TOOLS.1997.654738 )
Developing Distributed Software Systems by Incorporating Meta-Object Protocol (diMOP) with Unified Modeling Language (UML) , Joon-Sang Lee et al, 1997 (?) (DOI:10.1109/ISADS.1999.838366 )
First Steps to an Interaction and Communication Manager between Remote Objects , Laurent Berger et al, 1998
The Zypher Meta Object Protocol , Koen De et al, 1996
discusses the necessity of a meta object protocol in the design of an open hypermedia system.

In Tcl namespaces and namespace ensembles th building blocks for most object systems.

escargo 2006-11-03: The inclusion of a meta-object protocol can be the foundation of object-oriented extensions. I think of TIP 279

DKF 2009-05-14: Not really. It doesn't allow all that much flexibility in terms of the actual implementation semantics. That particular TIP allows any kind of OO system to be built, so long as it's XOTcl. It's the Henry Ford of core OO proposals. Writing a customizable MOP is very difficult; even now (having designed and implemented TclOO) I still feel I don't grasp the full space of possibilities firmly enough to be able to build a scripted customization interface for the basic semantics.

A Tcl Object Protocol

The term "protocol" implies some level of interoperability between otherwise autonomous actors. Therefore, the first principle of an object protocol for Tcl might be this:

An object should be able to use another object that has passed to it, regardless of the origin of the passed object.