Previous: Renderer Components
Next: Contexts and Demands
If you've done any object-oriented programming, you're probably familiar with the idea of packaging up functionality into small, reusable, modular bundles. The Infusion Framework provides many supports for designing your application as a collection of components that work together. Components can be combined with parent-child relationships, creating a component tree.
Consider an example: the Infusion Pager. This component allows users to break up long lists of items into separate pages. You've probably seen pagers used for search results, etc. The Infusion Pager is actually implemented as a number of smaller components working together. The Pager Subcomponents page explains the different subcomponents.
Using the Inversion of Control system, subcomponents are declared in a special property of the parent's defaults called
components object is collection of key/value pairs:
The subcomponent object can contain many properties, but the main one is the
type, which is the string name of the subcomponent function.
In addition to the
type of subcomponent, other configuration information can be given. These include:
options, for overriding the defaults of the subcomponent
The Infusion [fluid:(Floe) UI Options, A] (UI Options) component presents a collection of controls that allow a user to specify their preferences for customizing the presentation of the user interface and content resources. It works with the User Interface Enhancer (UI Enhancer), which carries out the transformations based on the recorded preferences.
The UI Options component has a component tree as shown to the right. Essentially:
You can see from this tree that the UIOptions component is being re-used by the three different versions.
The code for this looks as shown below: