Here's another idea that occurred to me recently. I suspect this one needs no vote, but perhaps it should be done sooner than other ideas like the filesystem-based web root.

I want a way to inspect all of the indirections chosen in the course of a web request or any other publishing operation. After executing a web request, Zope will report all of the points where it made a decision using the component architecture. It will show what decision it made and which ZCML directive caused it to make that choice.

I can think of three modes of operation. In the first mode, Zope will record decisions using an indirection reporting utility similar to the error reporting utility; developers will visit the utility to see the decisions. In the second mode, developers will add something to the URI (say, '++debug++indirect') that causes Zope to replace the result of the request with the indirection report. A third mode is to record the decisions using the utility but also mangle browser responses, adding a link to the report at the bottom of every web page. While I like the third mode best, mangling is evil, so it should be easy to turn it off and revert to just the first mode.

The report will consist of lines that look something like this, but more graphical: traverse(), line 36
    Adapted <object x> to INameTraverser, yielding <MyNameTraverser y>.
    Configured by 'adapter' directive at myapp/configure.zcml, line 72

I can imagine displaying this information inside differently colored boxes based on what type of indirection is being made. (One color for adaptation, another for utility lookup, etc.) I can also imagine inspecting the stack depth to infer a tree structure, perhaps making the report easier to read.

The point is to make most indirection transparent to both beginners and experts. Any time I want to change a decision, I use this utility to find out what decisions are currently being made, then I copy the appropriate ZCML directives and paste into my own code and start hacking.

Thoughts?  Will it work?  Should it be a priority?


Zope3-dev mailing list

Reply via email to