From: Brian G. <br...@qu...> - 2003-07-27 23:01:40
|
>In addition, having a "globals.wm" template would make it real easy for >one to define their #use statements in a central place... that isn't >buried inside of webmacro.jar Lets say we had a "globals.wm" that would include #use and #macro definitions and get #included as macro in every template. This file would have to live somewhere. And something would either have to point to it from the Webmacro.properties, or it would have to have a "magic" name (e.g., globals.wm) which WM would look for through the template loader. Knowing how much you like the magic name idea, lets assume that WebMacro.properties for the app will have something like IncludeInEveryTemplate: globals.wm (and there's no reason there can't be more than one of these directives.) How is this all that different, in terms of configuration effort, readability, or degree of magic, from WebMacro.properties having this (which works now): ContextTools.Foo: com.me.my.FooTool ContextTools.EricIsADoofus: com.me.my.DoofusTool >I can see this. However, one of the things I hear from the few template >designers I work with is "What is available for me to use in this >template?". Having a list of #use definitions at the top would make their >lives easier. Or harder. But having a way of generating a list of "what can I do within this WM app" might be a better approach -- something which dumps out the syntax of all known macros, tools, and directives. >#use, which is a pluggable directive that can be easily turned off... and >doesn't pollute Context.java and Broker.java. The Template.write() thing >is probably unavoidable. Given how little "magic" there is in Context and Broker now, I think that the amount of magic that would have to be infused into Template.write is probably greater. So under this approach, we might even be adding "magic"! -- Brian Goetz Quiotix Corporation br...@qu... Tel: 650-843-1300 Fax: 650-324-8032 http://www.quiotix.com |