Helios Kernel
include( "path/to/someLibrary.js" );
include( "path/to/someOtherLibrary.js" );
function init() {
// this function is the module initializer
// here you may use the objects declared in the included modules
someLibrary.doSomething();
var mySomething = new someLibrary.Something();
someOtherLibrary.doSomethingElse();
}
The benifit of such approach is that when you need to use some module,
you don't need to care about its dependences — this is the
module creator who should declare all dependences in the module head
using the include() function. You will just
need to load the single module you are going to use, and then Helios
Kernel will load up all the module's dependences and initialize them
in the appropriate order.
Using this technique, you may create a complicated structure of
dependences between the modules. Split your code, and simply use
the include() function in the head when you
need some routine. Don't worry about wether some module has already
been included — Helios Kernel will take care of loading the
needed sources when something is requested for the first time, and
will not load it again if the needed module has already been loaded.
Helios Kernel also provides
the kernel.require()
and kernel.release() functions which you
may use to dynamically load and unload the modules (along with all
their dependences) at the runtime.
There are also several usefull routines which allow to track the
loading process to probably reflect it into the GUI. One of such
routines is the kernel.getStatistics()
function which reports the detailed information about all of the
modules which are being loaded.
Helios Kernel is the client-side library, which means that you don't
need an http-server to try it.
Simply download the library,
unpack it somwhere on your hard drive, and load it into the browser
locally. And don't forget to read
the documentation.
| Who really cares about an author when there's such an amazing library? :-) Okay, here is a special bonus for those who read until the end: the author is Dmitry Prokashev from St. Petersburg, Russia. The following image generally describes what the author usually looks like (on the left): |
|