Metaobject DefinitionsMetaobject 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 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:
MODefinition theMODef = new MODefinition.SharedMO(<object reference>);
MODefinition theMODef = new MODefinition.SharedFactory(<factory ref>, CallDescriptor); (The second parameter is a call descriptor object that are reviewed in detaill in this section).
MODefinition theMODef = new MODefinition.MOClass(<class name>, Parameter...); (The second parameter is a parameter object that is reviewed in detaill in this section).
MODefinition theMODef = new MODefinition.FactoryClass(<class name>, CallDescriptor); (The second parameter is a call descriptor object that are reviewed in detaill in this section). |