Hi!
Florent Guillaume wrote: > Martin Aspeli wrote: >> yuppie-2 wrote: >>> If you write a new XML body to adapted.body the settings of the >>> workflow are changed. The body is not stored as a string, it is >>> stored as object tree. (So yes, the workflow is 'initialized' with >>> the settings defined in the XML file.) If you modify the object tree >>> TTW reading adapted.body will return the XML representation of the >>> modified settings. XML body and object tree are just two different >>> ways to look at and modify the same settings. >>> >> >> Right. I cringe slightly when writing to a property has side-effects >> beyond >> just storing a value (possibly with some checks or transformations, of >> course). In this case, it seems it does a lot more (changing >> portal_workflow >> for this implementation), in which case I think a method like update() >> would >> be more clear. > > I also never liked this GS API and would never do something like that in > my own code. Side effects should be more visible. 1.) Whether something is a side effect or not depends on the way you look at it. The only things I consider side effects are that in non-purging mode setting 'body' doesn't simply replace the old value and that in CMF 1.6 actions.xml modifies many different tools. I think supporting the non-purging mode is anyway a mistake (see http://mail.zope.org/pipermail/zope-cmf/2006-July/024665.html) and CMF 2.0 has no longer the actions.xml issue. 2.) Obviously many people look at this in a different way than I do. APIs are made for people and should be intuitive to use. Unfortunately the best feedback comes if APIs are already released and hard to change. If I had known how disruptive the current API is I would have chosen a different one. Cheers, Yuppie _______________________________________________ Zope-CMF maillist - Zope-CMF@lists.zope.org http://mail.zope.org/mailman/listinfo/zope-cmf See http://collector.zope.org/CMF for bug reports and feature requests