Anatomy of a StandardModule
General
Any Module, regardless whether it is a StandardModule or a ModelModule, is distributed in two parts:
- its ModuleAdvertisement, in at least one format
- a JAR file containing the code and resource files of the Module. Rarely, a StandardModule has more than one JAR file. The JAR file also contains the ModuleAdvertisement.
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.
StandardModuleAdvertisement
The ModuleAdvertisement of a StandardModule is defined in XML by the developer.
Here is an example:
<standardmodule> <name>org.infogrid.jee.rest</name> <username>JEE/REST support for InfoGrid.</username> <userdescription>Makes developing REST-ful applications with InfoGrid easier.</userdescription> <provides> <jar>org.infogrid.jee.rest.jar</jar> </provides> <dependencies> <requires name="org.infogrid.jee"/> <requires name="org.infogrid.kernel"/> <requires name="org.infogrid.util"/> </dependencies> </standardmodule>
The fields have the following meaning:
| name | the computable name of the StandardModule |
| username | the internationalizable name of the StandardModule that should be shown to a human user |
| userdescription | the internationalizable description of the StandardModule that should be shown to a human user |
| provides | section listing the JAR files the StandardModule uses |
| jar | lists the name of one of the StandardModule's JAR files. By convention, it is named after the StandardModule's name with a .jar extension |
| dependencies | section listing dependencies of this StandardModule on other StandardModules or ModelModules |
| requires | one dependency on another Module. The name of the required Module is required. |
As part of the default build process:
- the ModuleAdvertisement is exported not using the generic module.adv name that is used by developers to define it, but using the name of the StandardModule and potentially a version identifier with a .adv extension. In the example above, this would be org.infogrid.jee.rest.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.infogrid.jee.rest.V.ser.
- both forms are also included in the Module's JAR file at location infogrid-moduleads/.
See also:
