MetaClass?

A class whose instances are components of a class, or classes themselves.

There's an excellent description of MetaClasses in this Smalltalk tutorial. While we aren't programming in Smalltalk, most of the concepts mentioned apply to Faerie MUD?'s metaclass framework as well.

MetaClasses allow us to more easily share classes between servers, and also facilitate editing and manipulation via a web interface. They provide a high degree of introspection into the classes, and allow seperate chunks of them to be individually manipulated without resorting to parsing code. It also facilitates a high degree of automation, as a class that can ask itself what its attributes are can also generate accessors for those attributes in a sensible manner.

Faerie MUD?'s metaclass system is architected very similarly to the Unified Modelling Language, and in contrast to some metaclass systems, has metaclasses for not only Class, but also Method, Attribute, Interface, and Association, among others. This should allow us to build game classes by plugging together simple components, and manually coding only the interesting bits.

To our knowlege, there are no systems currently being used which are even similar to ours, so it remains to be seen what the benefits of a system with this much introspection can do.

Ged The Greys Hain - 20 May 2000

Ahem! Java.lang.reflect is pretty damn comprehensive, and used right to the roots. Just thought I should mention it. One advantage is that if I don't have a Java book to hand, I can write code to print the prototypes of every public method that, say, java.lang.Vector possesses. Who needs Nutshell...

AlexisLi? - 18 Dec 2001

Since I wrote that more than a year and a half ago, I've learned that quite a few languages have very good introspection, as AlexisLi? points out. Ruby has fairly good introspection, too, but what we propose to try is to use a metaclass layer to define the class heirarchy at runtime instead of just to get introspective data from it later. So, instead of classes in files on disk, we propose to create classes, their attributes and operations, and at least interfaces from data in a database. It's sort of a hybrid of data-driven programming and metaclasses.

The merits of this sort of framework, we theorize, are many, though whether they are enough to justify the additional complexity and danger remains to be seen. It will make the definition of classes in the world subject to the data model, so that the design reflects exactly the state of the metaclasses in the runtime system. Changing a method's implementation should be as easy as editing the data that defines it in the database. Another interesting aspect is that moving the classes to a network storage medium greatly increases the ease of synchronizing facets of the running world between multiple servers, allowing us to split the world across physical hardware without having to worry too much about transferring live objects between them. There will certainly be a fair share of peril involved, as well, but it will be an interesting experiment.

GedTheGreysHain - 19 Dec 2001