Modules are external script instrumented with a basic API to operate within the Hemi framework and be included in the Hemi.registry service. Similar to Application Components, the concept permits a typical external JavaScript format but which operates within its own namespace. The module class also includes basic support for unit testing, so that modules may be quickly written to act as externally loaded unit tests. For example, the Application Component Tests includes several unit tests for vetting the Application Component class.
Static implementation of the hemi.app.module.serviceImpl class.
The module service provides a convenience for modularizing and managing standard JavaScript as reusable components and tests.
A Module encapsulates the imported JavaScript and an API for operating within the framework.
Decorates a module content. Method is virtual and can be overridden.
sDecoration = DecorateModuleContent( sName, sPath, sRaw )
sDecoration as String: A value to be included in the module prior to the module being instantiated.
Decorates a module header. Method is virtual and can be overridden.
sDecoration = DecorateModuleHeader( sName, sPath, sRaw )
sDecoration as String: A value to be included in the module header prior to the module being instantiated.
Loads a Module definition.
oModule = LoadModule( sName, sPath, sDecoration, bPathIsContent )
oModule as Module: A new Module object.
Creates a new Module object.
oModule = NewModule( sName, oContainer, sPath, oModuleService, bPathIsContent )
oModule as Module: A new Module object.
Registers a Module object.
object = Register( sName, vContent )
object as object: Internal module object.
Unloads the specified module.
bRemoved = UnloadModule( sModule )
bRemoved as boolean: Bit indicating whether the module was removed.
Destroys all module implementations for the specified module.
bRemoved = UnloadModuleImplementations( sModule )
bRemoved as boolean: Bit indicating whether the module implementations were removed.
[ Hemi JavaScript Framework - Stephen W. Cote, 2002 - 2009. ]