FLUID-4170: Interaction between lifecycle functions is uncoordinated, resulting in unpredictable action and unexpected loss of grade-specific defaults

Metadata

Source
FLUID-4170
Type
Bug
Priority
Major
Status
Closed
Resolution
Fixed
Assignee
Colin Clark
Reporter
Antranig Basman
Created
2011-04-01T04:43:51.286-0400
Updated
2014-03-03T13:11:42.593-0500
Versions
  1. 1.3.1
Fixed Versions
  1. 1.4
Component
  1. Framework

Description

The action of the "graded lifecycle functions" named preInitFunction, initFunction, postInitFunction and finalInitFunction has been implemented in an "ad hoc" way, which makes it unlikely that the action of multiple lifecycle functions registered at different grades or at the same grade can be successfully coordinated. In particular, a "plain preInitFunction" registered for a particular component right now will destroy the action of the grade-specific default for "fluid.modelComponent". Likewise, users may wish to override the action of grade-specific lifecycle functions in a controlled way.
The best way to resolve this situation is to appeal to the existing Fluid events system. Although lifecycle functions execute exactly once, all of the same protocol for priority and namespacing as well as interaction across options merging is precisely that required to operate the coordination we require.
Furthermore, adopting the same mechanism and semantics as the event system will allow users who are familiar with it to transfer their knowledge to lifecycle functions, and vice versa.
A slight change in syntax for the model-bearing grade's "preInitFunction" will be required to accommodate this change.