[ engine demonstrations | engine overview | imnmotion.com | Stephen W. Cote ]
Where Engine Demonstration #7 showed how the Application Component could be used to create dynamic components from an Engine Service configuration, Demonstration #8 takes a closer look at creating runtime components from local and imported definitions, and creating compiled components. The purpose of using the Application Component to create runtime components from local and imported definitions is to give developers a means to create dynamic objects in a controlled environment, and also to allow developers to compile those dynamic components back into the Engine architecture for use as a static component.
The files required for this demonstration are as follows:
The following interactive example shows how a definition is imported into an Application Component. A definition is nothing more than the kernel of the component; in this example, the component_init and component_destroy hooks. Developers may define their own functions, or append their own properties directly to the object. To use this example, try adding your own custom function, or altering one of the existing functions, and then click the Load Text Definition button. Alternately, you can try loading the definition from an XML file by clicking the Load XML Definition button. Scroll to the bottom of the page to review the results.
The following interactive example shows how the previous definition (including whatever changes you made) can be compiled into your own Application Component. This is made possible because the Engine SDK includes a prepared skeleton. Developers may load the skeleton, configure it, and specify their own custom code. By specifying the Package Name and Class Name, the Application Component can be built to use any name you desire. With the Engine SDK, the component can then be folded back into the primary engcomp.js source file. In this example, the compiled component is evaluated on the fly. Scroll to the bottom of the page to review the results.
: Package Name
: Class Name