cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Larson <>
Subject Re: [Question] Re: cforms plans, templating engines, etc.
Date Wed, 10 Nov 2004 20:23:12 GMT
On Wed, Nov 10, 2004 at 08:54:33PM +0100, Sylvain Wallez wrote:
> Tim Larson wrote:
> >On Sun, Nov 07, 2004 at 09:29:40PM +0100, Sylvain Wallez wrote:
> >>Tim Larson wrote:
> >>>On Fri, Nov 05, 2004 at 09:58:43PM +0100, Sylvain Wallez wrote:
> >>>>Tim Larson wrote:
> >>>>
> >>>concerns before.  I will try to take some time this weekend
> >>>to see how to resolve this.  I really do not want to revert
> >>>the code if we can just improve it instead.  I just feel
> >>>pressured by the short time before we plan to release.
> >>>
> >>So let's discuss your concerns. I started looking at Swan, and it seems 
> >>to me that what's needed is simply and additional "output" state.
> >>
> >>Do you want me also to explain more clearly how states are implemented 
> >>and behave (lacked the time to write some docs)?
> >
> >I finaly got to look at the widget states implementation,
> >and even port parts of Swan to use it (working on porting
> >the rest now).  I see some things we can improve, but it
> >looks good overall because of the separation between how
> >we set states and how we query them.
> Do you mean the distinction between getState() and getCombinedState()? I 
> implemented it that way because I felt that we may need to now the 
> actual state of a widget and not always the combination with it's parent 
> state according to the state priority rules.

Yes, I like the the getState()/getCombinedState() split,
and also the split between how we set a state (currently
all attributes at once: readable, writeable, styling hint)
versus how we query the state with isXXX (quering the
attributes individually.)  This will permit us to later
allow setting the different attributes independently
(if the need develops.)

> >This will allow
> >us to add more fine-grained state setting logic without
> >disturbing existing state querying logic (if we find we
> >need these changes in the future.)  I will comment on
> >the possible improvements later when I have collected
> >my thoughts more, since they should not affect back-
> >compatibility anyways.
> Ok, waiting :-)

The most visible problem is that getCombinedState() is
called several times per widget, and (iiuc) it climbs
up to the root of the widget tree on each call.  This
would be rather inefficient for a deeply nested form,
such as an xml editor.  Perhaps we should reverse and
cache the updates, having a parent notify its children
when its state changes?  This would cut the number of
tree passes considerably, at the cost of some memory
use for caching the combined states.

> >[Question:]
> >
> >Is this change acceptable for keeping in the trunk and
> >including in the stable branch?  (The part about changing
> >from isAcceptingInputs() to isValidatingValues() in
> >the widgets' validate() methods?)  Currently both methods
> >will return the same value, but this will allow us to
> >split the logic later if needed.
> Good idea. The various isXXX methods on WidgetState are meant to avoid 
> direct reference to actual state constants within the code. That firstly 
> avoids inconsistencies and also allow later extension if needed (once 
> again, I think we'll need to add an "output" state).
> So go on merging in the stable branch!

Ok :)

> >>Well, you've got a point here: yes, you should probably explain more 
> >>what you want to do. The group's feedback will strengthen the ideas and 
> >>turn them into a collective creation rather than a one-man show.
> >
> >Agreed.  I will update my wiki page to explain my current
> >plans, so they can be discussed, changed, and improved :)
> Good idea, but rather than your page or WoodyScratchpad, what about a 
> new CFormsScratchpad or a [RT] so that we can all work collaboratively 
> towards well-defined evolutions?

Yes, that sounds like a better way.

--Tim Larson

View raw message