|
|
(10 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | In object-oriented programming, a metaclass is a class whose instances are classes.
| + | #redirect [[MetaClass]] |
− | Just as an ordinary class defines the behavior of certain objects, a metaclass defines the behavior of certain classes and their instances. Not all object-oriented programming languages support metaclasses.
| + | |
− | Among those that do, the extent to which metaclasses can override any given aspect of class behavior varies.
| + | |
− | Each language has its own metaobject protocol, a set of rules that govern how objects, classes, and metaclasses interact.
| + | |
− | | + | |
− | Often [[Namespaces]] are used as identifiers in Metaclasses, to distinguish different classes.
| + | |
− | | + | |
− | ==Generating a metaclass==
| + | |
− | | + | |
− | Will man ein neues Metadatum erstellen, muss man, ausgehend von der Baseclass, Rechts klicken und „Derive new object“ wählen.
| + | |
− | Anschließend kann im unteren Fenster im Reiter Object der Name des Metadatums geändert werden.
| + | |