Anatomy of a ModelModule
- its ModuleAdvertisement, in at least one format
- a JAR file containing the code and resource files of the Module. Rarely, a ModelModule has more than one JAR file. The JAR file also contains the ModuleAdvertisement and the file defining the Model.
The ModuleAdvertisement tends to be small and thus can be downloaded very quickly, while the JAR is often orders of magnitude larger. By allowing independent download of the ModuleAdvertisement, it becomes more viable to implement software architectures in which applications can dynamically evaluate Modules on the network for possible use during the current application run. InfoGrid originally implemented this architecture to enable Java WebStart-based rich client applications to learn about, and possibly add, additional available Modules at run-time.
As part of the default build process:
- the model.xml file is exported not using the generic model.xml name that is used by developers to define it, but using the name of the ModelModule and potentially a version identifier with a .xml extension. If the ModelModule was named com.example.mymodel, the exported Model file would be named com.example.mymodel.V.xml.
- the generated ModuleAdvertisement is exported using the name of the ModelModule and potentially a version identifier with a .adv extension. In the example above, this would be org.example.mymodel.V.adv.
- the XML form of the ModuleAdvertisement is translated in a more efficient form using Java object serialization. This is an alternate form of the ModuleAdvertisement, named org.example.mymodel.V.ser.
- both ModuleAdvertisement forms are also included in the Module's JAR file at location infogrid-moduleads/.
- the Model file is included in the Module's JAR file at location infogrid-models/.