Core Module of Legal Box Scalable JavaScript Application
Each Module corresponds to an independent unit of functionality.
For the purpose of this life cycle management, a new Module instance is created for each User Interface Module and each Data Model Module added on the Core Application.
Eric Bréchemier © 2011-2013, Some Rights Reserved Legal-Box SAS © 2010-2011, All Rights Reserved
BSD License http://creativecommons.org/licenses/BSD/
2013-09-09
lb. | Core Module of Legal Box Scalable JavaScript Application |
Functions | |
new Module(id,creator): Module | Constructor of a new Core Module. |
getId(): string | Get the module identifier. |
getSandbox(): object | Get the sandbox allocated to the module. |
start() | Create and start the underlying module. |
end() | Terminate the underlying module. |
Constructor of a new Core Module.
id | string, the module identifier, e.g. ‘lb.ui.myModule’ |
creator | function, a creator function returning a custom module. A new Sandbox instance will be provided as parameter. |
object, the new instance of Module
Creator functions for User Interface modules may be registered in the namespace ‘lb.ui’, e.g. lb.ui.myModule while creator functions for Data modules, with no user interface, may be registered in the namespace ‘lb.data’, e.g. lb.data.myModule.
The sandbox API can be customized by configuring a different builder to load additional or alternative plugins. See lb.core.plugins.builder for details.
Create and start the underlying module.
Terminate the underlying module.
The end() method is optional on the underlying module; it will not be called when omitted. In any case, removeAllListeners() will be called on the sandbox to cleanup any remaining DOM listeners, and destroyElement() will be called on the configured factory to terminate the box element and any widgets included within.