Note |
---|
This tutorial has not yet been updated to reflect post-1.4 Framework changes. |
Introduction
The Infusion framework has a lot going on, so here's an attempt to boil it down to some basic concepts with you, the developer, in mind. You might be at a place where Infusion sounds like it will be useful to you, and you're ready to start trying it out, but need a bit more direction on where to start and how to approach it. There are a few things to keep in mind before you dig in - hopefully this will help set the stage for getting into the code.
...
Inversion of Control - a new feature in Infusion to make using components together easier and cleaner. Instead of a parent component having to directly initialize subcomponents, IoC lets you declare subcomponents and their options through its instantiator. The instantiator will add them to a "resolution stack" where then a component can ask IoC to pick out information from components in the stack as it needs, without having the responsibility of creating or even knowing too much about them.
Pre-built components
The Infusion package ships with several pre-made reusable, accessible user interfaces such as Uploader, Progress Bar, Inline Edit, etc. We call these components as well. It may seem to muddy the waters when defining what a component is, but now that you know about what makes up a component, and what are subcomponents, it's easy to see that these interfaces are simply a combination of functionality into bigger components with options, events, models, and functions.
...
Events - a system of firers and listeners
Types of components
Different combinations of component pieces
Little Component - just options
View Component - options, dom binder, events
Renderer Component - view stuff + renderer
...
Now it's time to dig in. The best place to start will probably be to create a component from scratch. Let's try making the bar-graph component mentioned above over at Creating a Component.