[Twisted-Python] The problem with Twisted...

Philippe Lafoucrière lafou at wanadoo.fr
Thu Jun 5 14:10:42 MDT 2003


> You can, but you should not. Factory methods have one purpose and one 
> purpose only: To return a new object.
> 
> Update methods are special because they allow you to write the 
> equivalent of a new Widget class with an overridden setUp method, 
> without writing a new class.
> 
> Why does it matter so much where the DOM manipulation occurs? Because 
> one of the design goals of woven was to allow a portion of an 
> already-rendered page to be re-rendered. The way this is currently 
> implemented is by keeping the Widget instances produced by the 
> wvfactory_ methods in memory so that the generate (and thus setUp) 
> methods may be executed again multiple times.
> 
> How is wvupdate_ different? When woven notices a wvupdate_ method, it 
> creates a generic Widget instance and places a function pointer to the 
> wvupdate_ method on this instance. In this way, the wvupdate_ method 
> can be executed multiple times in order to re-render that portion of 
> the page.
> 
> I know it is confusing, and I hope to remove some of this complexity in 
> a future woven version.
> 
> dp

Thank you for this clear explanation ! I understand now !





More information about the Twisted-Python mailing list