====== Metaobject Definitions ====== Metaobject definitions are a standard way to describe how Reflex will obtain a reference to a behavioral metaobject at runtime. The base (abstract) class for all metaobject definitions is [[http://reflex.dcc.uchile.cl/svn/base/trunk/src/reflex/api/link/MODefinition.java|MODefinition]], that is declared as follows: public abstract class MODefinition{ public abstract String getCode(BLink aBLink, Operation aOperation); } As you can see, it defines just one method that should return the code to obtain a behavioral metaobject reference. As implemeting this method is not a trivial task, Reflex provides four subclasses that meet almost any requirement: * [[http://reflex.dcc.uchile.cl/svn/base/trunk/src/reflex/api/link/MODefinition.java|SharedMO]], a pre-existent (already instantiated) object will be used, for example: ''System.out'' or an object obtained from a framework. MODefinition theMODef = new MODefinition.SharedMO(); * [[http://reflex.dcc.uchile.cl/svn/base/trunk/src/src/reflex/api/link/MODefinition.java|SharedFactory]], a pre-existent factory of metaobjects will be used. This factory will be asked for every metaobject that is about to be used and that has not been initialized yet. MODefinition theMODef = new MODefinition.SharedFactory(, CallDescriptor); (The second parameter is a call descriptor object that are reviewed in detaill in this [[call_descriptors_parameters|section]]). * [[http://reflex.dcc.uchile.cl/svn/base/trunk/src/src/reflex/api/link/MODefinition.java|MOClass]], a new object will be created, based on the description given to the MOClass object: MODefinition theMODef = new MODefinition.MOClass(, Parameter...); (The second parameter is a parameter object that is reviewed in detaill in this [[call_descriptors_parameters|section]]). * [[http://reflex.dcc.uchile.cl/svn/base/trunk/src/src/reflex/api/link/MODefinition.java|FactoryClass]], a new factory of metaobjects will be used. This factory will be asked for every metaobject that is about to be used and that has not been initilized yet. MODefinition theMODef = new MODefinition.FactoryClass(, CallDescriptor); (The second parameter is a call descriptor object that are reviewed in detaill in this [[call_descriptors_parameters|section]]).