Modules are objects that execute business/presentation logic.
In Turbine, you have 5 types of modules :
Guara takes a new approach.
We choose to have a generic ModuleExecutor valve, which grabs module names from your request parameters
and tries to execute them calling
int doPerform(RunData runData, Context context) throws Exception;
OBS: for action modules, one can define a specific method to be executed, not only doPerform()
The ModuleExecutor is responsible for determining the name of the module that is going to be loaded,
thats is why we can defined default modules for a particular request.
Other task performed by the ModuleExecutor is recursive module lookup, which walks on the package tree trying to find the module by it's class name. If no module is found, a module called Default is returned.
Here is how it worksOnce the module name is determined, the ModuleExecutor calls ModuleLoader.loadModule(String name, String type) which checks it's internal cache first, if null, it searches the module tree and creates the module using it's name and type using the Factory component.