Component lifecycle hook 'functions' as event listeners?

Antranig Basman antranig.basman at colorado.edu
Wed Sep 21 05:00:17 UTC 2011


On 20/09/2011 14:37, Cheetham, Anastasia wrote:
>
> Hey, Bosmon,
>
> I have a question about the component creation lifecycle hook points.
>
> Technically, the functions that developers can specify are event listeners, which means that technically, they can be specified as event listeners are specified: they can have a namespace and a priority.
>
> My question is this: Is this something we want to let integrators know about? Or do we actually want to prevent them from realizing that these functions technically implemented this way?
>
> Put another way: Do we want to discourage integrators from providing namespaces or priorities?
>

Hi AC - I would soft-pedal the lifecycle functions somewhat, since although they are "official and 
supported" they are not the final scheme we will use for this purpose, due to their considerable verbosity 
and large demands they make on the memory of users to remember which lifecycle point is which (I typically 
forget myself and have to look it up). When we have the "globally ginger world" the lifecycle points will go 
away again (that is, we will deprecate them for one major release, once we are satisfied we can do 
everything without them, and remove them in the following release). So I would not go overboard in delving 
into the implementation details in the explanation. You can just refer the reader to the standard 
documentation on events for these details (which will, in contrast, remain stable).
On a related note, we probably want to highly encourage users to supply namespaces for standard listeners - 
that is, ones which are registered as part of a component's defaults and possibly also demands. Without 
this, it is very hard for users of a component to take control of whether listeners they supply should 
override builtin ones or not. Several bugs I have fixed recently have just been done through adding a 
namespace to a component's own listeners.
There is currently a framework bug that in some circumstances, a user-supplied listener with no namespace 
will override a default listener rather than adding on to it. Lifecycle listeners do not suffer from this 
bug and accumulate properly.

Cheers,
Antranig


More information about the fluid-work mailing list