class Standard . AutomaticClassLoader {
oid loaderService;
set searchPath;
oid serviceOID;
string thisServiceName;
} inherits from Object;
New class implementations can be loaded into a FARGOS/VISTA Object Management Environment using the facilitilies provided by LoadObjectFile and LoadOIL2File. Historically, such loading has been performed as the result of explicit creation of such objects in the initial rc file.
The service provided by an AutomaticClassLoader object eliminates the need for such explicit load requests. When created, an AutomaticClassLoader object registers itself with the local environment to handle certain errors encounted by the ObjectCreator object during createObject and importObject requests (as well as any similar methods). If a class is not currently loaded or a class inherits from an unloaded class, the AutomaticClassLoader object will attempt to locate and dynamically load a class implementation.
Note: currently, the interaction between AutomaticClassLoader and ObjectCreator is treated as an undocumented API; similarly, while the externalization of functionality in classes such as ClassLocator provides a framework for replacing/extending the search and load operation, the interfaces are not yet frozen and exposed for local replacement.
If the list of available classes is undergoing frequent change, it can be advantageous to always generate a new configuration database prior to the creation of the AutomaticClassLoader object. This is illustrated by the 3 lines below:
LoadOIL2File "file:$VISTA_ROOT/oil2anf/clMakeANFlist.o2o" MakeOIL2ANFprofile AutomaticClassLoader
The disadvantage is that creation of the database can take a noticeable amount of time. If the FARGOS/VISTA runtime is being used to run short applications, redundant creation of the configuration database will be viewed as too expensive.
AutomaticClassLoader:create()
The create method currently takes no arguments. A ClassLocator object will be created in order to locate on demand any needed classes.