[Twisted-Python] Woven Refactor

Donovan Preston dsposx at mac.com
Fri Jan 24 16:10:41 MST 2003


Hello everyone in Twisted land,

This is an experimental Woven View refactoring that I have been working 
on for the past two weekends. What does it do?

* Uses a flat list of outstanding DOM nodes instead of recursion to 
keep track of where Woven is in the page rendering process

* Removes View's dependency on DOMTemplate as a base class, in 
preparation for deprecation of DOMTemplate (all of the same semantics 
are now directly implemented in View). As a result, View has no base 
classes, making the inheritance chain cleaner.

* Stores the namespace stacks (model, view, and controller name lookup 
chain) in the View directly, and each widget gets an immutable 
reference to it's position in the lookup chain when it is created, 
making re-rendering Widgets more reliable

* Represents the namespace stacks as a cons-like tuple structure 
instead of mutable python lists, reducing confusion and list-copying; 
instead of copying the current stack lists each time a Widget is 
created, it just gets a reference to the current tuples for each of the 
stacks

What does that mean?

* The tracebacks are far shorter now, since we're no longer recursing 
deeply into the DOM tree

* Namespace stack behavior is less buggy now; some of the outstanding 
mysterious bugs regarding rendering Widgets that have a Deferred model 
should hopefully go away

* View has no base classes now, making the inheritance tree much 
shallower

What do I need before I check it in?

* Feedback! If you have a Woven application, please apply this patch 
and let me know if anything breaks. There are no API changes, and 
behavior should be the same (unless you were relying on the older, 
possibly buggy behavior; this shouldn't be the case)

Assuming all goes well, I will check this in this weekend. Once I do, 
it paves the way for further cleanup of the Woven codebase. Onward and 
upward towards stable Woven!

Donovan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wovenRefactor.diff
Type: application/octet-stream
Size: 24494 bytes
Desc: not available
URL: </pipermail/twisted-python/attachments/20030124/126c7aee/attachment-0002.obj>
-------------- next part --------------



More information about the Twisted-Python mailing list