by paul — last modified 2006-01-20 19:06
Some of the goals and issues for the pipeline stuff I've been working on.
The pipeline model I've been working on allows presentation work (templating) to be done outside Zope with off-the-shelf tools, then seamlessly integrated back into Zope. My current work is heavily tilted towards XML/XSLT-based pipelines, but other technologies can participate as well. This page captures some of the goals of this approach.
- Make a radical improvement in the productivity and learnability of presentation development.
- Leverage great tools.
- Leverage copious documentation about other technologies.
- Improve performance of page rendering.
- Improve the productivity of the debugging process.
- Speed up the consulting process by allowing UI to be developed against a static model, then replaced at the end by a dynamic model.
- Lower some barriers to entry regarding common standards and technologies.
- Same pipeline definition and processing works outside Zope (using the <oxygen/> editor, for example) and inside Zope (using libxml2 and libxslt).
- Break processing into multiple, focused stages whose inputs and output can be viewed, verified, and debugged.
- Might want a tool like oxygen to wire up to live Zope data instead of a static model on disk as XML files.
- Aim for a well-scoped target, such as presentation UI only.
- Understand the difference between what's currently called "skinning" (with gobs of programmer stuff mixed into rendering) and a "theme", where the customer's Dreamweaver person applies the corporate identity and site structure.
- Possibility for "contracts" between stages that can be validated using unit tests. Helps implement the blame game, so that less technical people downstream in the process know they did or didn't screw up.
- Pick technologies that are a good fit for certain task. XSLT might fit for drawing a tree, SAX for link rewriting and resolution, etc.
- Smooth migration path. Allow the output of existing ZPT to become the input to a pipeline.
- Allow a pipeline to impose itself on a site or parts of a site, even if the various templates didn't choose to include the ZPT macros.
- Avoid brilliance in the pipeline architecture. We have too much brilliance already. Try to stick to immediately obvious ideas that don't require new specifications, architectures, documentation, and surprises.
- Leave open the possibility to shift some stage processing to Apache.
- URI vs. object. Editors like oxygen want input documents as files or URLs. In Zope, we want to cache data as Python objects and certainly don't want to make an HTTP request from Zope out to Zope to retrieve a string of data and make a DOM. However, we really want the same pipeline definition to work unchanged with a static model (oxygen + XML files on disk) or inside Zope.
- libxml2 will never do XSLT2, XPath2, XQuery, etc. Doesn't look at this stage as if any Python-capable XML engine will implement those standards.
- Many of the XML editors on the market are written in Java. Obviously, our Zope side is Python+libxml2. This limits choices or increases work for choices such as extension functions that might solve some issues.
- Multiple input docs. libxslt can't pass in nodes as parameters. Thus, you really only get one input DOM. From inside, you can point at a URI and get some more nodes, or write an extension function. But it would be a bit nicer if you could pass in data you already had lying around as part of the transformation input.
- If we want to have stages whose output can be validated, that means using schemas (RNG, for example) for XHTML. That means no null namespaces. That means that XSLT authors have to put the html prefix in front of every div, p, h1, etc. that they want to match on in XPath expressions.
- XSLT has a negative reputation, some of it deserved, some not.
- Slippery slope on complexity. For example, it is tempting to promote template reuse with xsl:include and xsl:import. This opens the same kind of "where did that come from" reaction that ZPT macros produce.
- Might be hard to pinpoint performance gains. Since this architecture will rely on some tricks like keeping pre-computed DOMs until state changes, it might be hard to do an apples-to-apples comparison to existing template architectures.
- With the DOM, static models as XML files, and even RNG schemas, we have a much more obvious way for people to discover the data model. But with Zope, CMF, Plone, AT, and custom types, there is a mish-mash of Python methods in some state of documentation that are used to grab data. With this model, someone earlier in the pipeline has done that work for you.