World Library  
Flag as Inappropriate
Email this Article

Meta-object protocol

Article Id: WHEBN0000191423
Reproduction Date:

Title: Meta-object protocol  
Author: World Heritage Encyclopedia
Language: English
Subject: Lisp (programming language), Perl
Publisher: World Heritage Encyclopedia

Meta-object protocol

In computer science, a metaobject or meta-object is any entity that manipulates, creates, describes, or implements other objects. The object that the metaobject is about is called the base object. Some information that a metaobject might store is the base object's type, interface, class, methods, attributes, variables, functions, control structures, etc.

Metaobject protocol

A metaobject protocol (MOP) is an interpreter of the semantics of a program that is open and extensible. Therefore, a MOP determines what a program means and what its behavior is, and it is extensible in that a programmer (or metaprogrammer) can alter program behavior by extending parts of the MOP. The MOP exposes some or all internal structure of the interpreter to the programmer. The MOP may manifest as a set of classes and methods that allow a program to inspect the state of the supporting system and alter its behaviour. MOPs are implemented as object-oriented programs where all objects are metaobjects.

Runtime and compile time

MOPs may be run-time or compile-time. The metaobjects of runtime MOPs exist while a program is running, or executing. On the other hand, the metaobjects of compile-time MOPs exist only while a program is compiled. They may alter or extend the compiling process, but do not exist when the program is running.

One of the best-known runtime MOPs is the one described in the book The Art of the Metaobject Protocol (often referred to as AMOP); it applies to the Common Lisp Object System (CLOS) and allows the mechanisms of inheritance, method dispatching, class instantiation and so on to be manipulated. At Xerox PARC, one of the authors of AMOP, Gregor Kiczales, developed a small but powerful MOP-based runtime object system in Scheme called TinyCLOS.[1] which has been ported to many Scheme implementations.

A good example of a compile-time MOP is OpenC++.


One example use of a MOP is to alter the implementation of multiple inheritance. A recurring issue is how to resolve conflicting slots and methods of the superclasses. Typically, language designers select one solution, and language users must live with it. Instead, a metaobject protocol makes it possible to change the rules of inheritance and choose a different solution for individual classes.

A metaobject protocol is one way to implement aspect-oriented programming languages. Many of the early founders of MOPs, including Gregor Kiczales have since moved on to be the primary advocates for aspect-oriented programming.

See also


External links

  • The Guile MOP specification (GOOPS, based on Tiny CLOS)
  • Metaobjects and the Metaobject Protocol
  • The Common Lisp Object System MetaObject Protocol (contains two chapters from The Art of the Metaobject Protocol)
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.