Metaobject

Metaobject

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.

Contents

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. Instead, 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++.

Usage

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

References

  1. ^ Shigeru Chiba, Gregor Kiczales and John Lamping, Avoiding Confusion in Metacircularity: The Meta-Helix in Proceedings of the Second JSSST International Symposium on Object Technologies for Advanced Software, Kanazawa, Springer-Verlag LNCS 1049, pp 157-172, 1996

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • metaobject — noun Any entity that manipulates, creates, describes, or implements others …   Wiktionary

  • The Art of the Metaobject Protocol — The Art of the Metaobject Protocol, (1991) or simply AMOP, is a book by Gregor Kiczales, Jim des Rivieres and Daniel G. Bobrow on metaobject protocol. It contains an explanation of what a metaobject protocol is, why you want one, and the de facto …   Wikipedia

  • Common Lisp Object System — For other uses, see Clos (disambiguation). The Common Lisp Object System (CLOS) is the facility for object oriented programming which is part of ANSI Common Lisp. CLOS is a powerful dynamic object system which differs radically from the OOP… …   Wikipedia

  • Class (computer science) — In object oriented programming, a class is a programming language construct that is used as a blueprint to create objects. This blueprint includes attributes and methods that the created objects all share.More technically, a class is a cohesive… …   Wikipedia

  • CLOS — Das Common Lisp Object System (kurz: CLOS) ist die objektorientierte Erweiterung der Programmiersprache Common Lisp. Es hat seine Ursprünge in Loops und Smalltalk, und ist im ANSI Standard über Common Lisp spezifiziert. CLOS wird durch das… …   Deutsch Wikipedia

  • Common Lisp Object System — Das Common Lisp Object System (kurz: CLOS) ist die objektorientierte Erweiterung der Programmiersprache Common Lisp. Es hat seine Ursprünge in Loops und Flavors, und ist im ANSI Standard für Common Lisp spezifiziert. CLOS wird (optional) durch… …   Deutsch Wikipedia

  • Common Lisp — Paradigm(s) Multi paradigm: procedural, functional, object oriented, meta, reflective, generic Appeared in 1984, 1994 for ANSI Common Lisp Developer ANSI X3J13 committee Typing discipline …   Wikipedia

  • Class (computer programming) — In object oriented programming, a class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable …   Wikipedia

  • Meta-Object Facility — Иллюстрация MetaObject Facility Meta Object Facility (MOF) стандарт Object Management Group (OMG) для model driven engineering  методологии разработки, основанной на моделях. Официальное описание стандарта может быть найдено на сейте OMG …   Википедия

  • Meta-Object Facility — Illustration of the Meta Object Facility. The Meta Object Facility (MOF) is an Object Management Group (OMG) standard for model driven engineering. The official reference page may be found at OMG s website.[1] Contents …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”