Version 1.4 of Infusion introduces Inversion of Control (IoC), and with it, new techniques for component creation, and a new component lifecycle. For information on this, see:
The information on this page is still accurate, and the techniques described here will continue to be supported until at least v2.0 of Infusion, but we recommend you use the new IoC methods.
This page outlines the sequence of events in the instantiation of a Fluid component. Some of these events are the responsibility of the runtime, some, of the user, and some, of the Fluid framework.
Setting up a Fluid component
Defining a component requires two steps:
- Registering the component's default options with the framework by issuing a call to
- Defining a suitably namespaced creator function which constructs the component.
These two actions may be performed in any order, since none of the code in the creator function will execute until the component is instantiated. As well as general default options,
fluid.defaults also sets up the structure for particularly meaningful component configuration such as events, DOM binding selectors and subcomponents. This section of the process is covered by the Fluid Component API page.
|title||On This Page|
A component may express a stronger contract by representing itself as model-bearing, which is described in Fluid Component API and Component Model Interactions and API. It is probable that a future version of the Infusion framework will assist this by supplying an initialisation directive
initModel to accompany
initView, in association with the ChangeApplier