[Seaside] dynamically chosen subcomponents

Avi Bryant avi@beta4.com
Thu, 13 Jun 2002 11:36:20 -0700 (PDT)

On Thu, 13 Jun 2002, Tim Rowledge wrote:

> My question is whether one its seen as very preferable to another.
> Without spending a bunch of time measuring (and then wondering if my set
> of machines it at all typical) is ther any strong opinon on the likely
> performance differences. After all, the hacky if-then-else plays well
> with the normal cached templates idea whereas the inspectors hack sort
> of defeats it.

Nah, it doesn't defeat it.  All that's actually in the template is a
placeholder element (IAPageProxy), which says "there's a subcomponent here
with id 'foo'".  Every time the template is rendered it pulls the actual
subcomponent out of the parent's 'children' dictionary.  That dictionary
gets messed with all the time (when a subcomponent does callPage:, for
example), all you're doing is messing with it in an unconventional way.

The if/else hack strikes me as a tiny bit better simply because it isn't
messing about in the internals and thus is more likely to continue to
work with new versions, etc (although hopefully any changes to new
versions would be such that these hacks were no longer necessary!).