From: Brian G. <br...@qu...> - 2003-07-16 19:39:03
|
>But seriously, how about cleanupTools()? A better name. Here's a thought that occurred to me on the drive over to work (see, traffic is good for something.) We have an implicit bracketing of "use the context" in Template.write() and Template.evaluate(). So how about adding the following to Context: - addCleanupHandler (added by tools which need cleanup) - beginEval (used ONLY by Template.write/evaluate) - endEval (used ONLY by Template/write/evaluate) beginEval would increment a count, endEval would decrement it -- when the count reached zero, cleanup handlers would be called. Since the open/close calls would live only in Template.write and Template.evaluate, users need not worry about it at all. But we'd still get automatic cleanup of things registered with the context, with the user having to be involved. -- Brian Goetz Quiotix Corporation br...@qu... Tel: 650-843-1300 Fax: 650-324-8032 http://www.quiotix.com |