Sorry, I just want to correct myself a bit:
It is actually possible to combine the two apporaches by creating a separate component tree for each template of the page/component (or something immitating that), rather than a single one for all, as it is now.
That would require either a lazy component tree initialization when a template is loaded (which would change the component finishLoad() contract somewhat), or by hunting down all possible templates at runtime and initializing them then (slow, but then that occurs only once per page instance).
In any case, this can lead to some pretty tricky problems. Here is a sample:
- two components of different types using the same ID in different templates. That would do wonders if those have persistent properties. One solution is to ensure that components in different templates have different IDs (say by prepending the template name/locale)
- if the above solution is adopted, then getting those components with getComponent() would become tricky -- you need to know which template you are interested in.
- a required component may be present in one template, but missing in another. That could be Body or Form or something else. Then again, a variations of that can occur even now.
I think that problems will appear especially strongly during maintenance, but hopefully precisely that will force people to use the specification files instead.
In any case, this appears to be a possible solution to the problem.
-mb
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com
