[Bese-devel] Re: component tree
Marco Baringer
mb at bese.it
Fri Jun 16 07:42:18 UTC 2006
Lou Vanek <vanek at acd.net> writes:
> [bump]
>
> ...
> Next question. I'm working on the make-new-callback thing now, because
> it doesn't behave very well in some situations (multiple forms, which
> have names with the same fields, on a page, and when you want to
> always run some code when a form is submitted, for use with checkboxes
> and multi-select inputs)... but I am running into some serious
> terminology confusion.
can you explain this multiple form problem better? i may just be a
very simplistic form user, but multiple forms on a page have never
caused me any grief.
> Also, is there something I could read to get some more clue on what
> the 'component tree' is? I actually thought it was just a stack... but
> some comments in the ucw sources are telling me it is an actual
> *tree*. How does it work, where is it stored, and when exactly are
> components copied/re-created?
components are never copied or created unless the developer explictly
calls make-instance (or CALL, which is a wrapper around, among other
things, make-instance).
The component "tree" is an actualy tree and it is rooted at the object
in the frame's window-component slot. many components will also have
nested-components (sometimes refered to as sub-component in the
source). a nested component is nothing more than a clos slot whose
value is a component object (this slot was, 99% of the time, declared
via a :component slot argument). The component "tree" is used during
the rendering phase, it serves two purposes: 1) we assume (but do not
stritly enforce) that rendering a component will also render all of
its sub components and 2) when creating urls for links a component can
add reuest parameters to all of the links created by itself and all of
its children. the point of this later feature is to allow a
search-results-viewer component to change the links created by its
nested item-details components so that, should the user's session
expire, or the link be sent via email, the search data can be
recreated.
There is also a component stack, which is completly unrelated to
component rendering. the component stack ties a component to the
component which call'd it. in the counter example, when the page is
asking you "are you sure you want to answer ... to ...?", that query
component was called by another query component which was called by
the counter component. this component stack is maintained via the
calling-component slot in component objects. you can, 99.9% of the
time, completly ignore this component stack.
questions?
--
-Marco
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
More information about the bese-devel
mailing list