Nathan Bubna wrote: ...
>> /** >> * Returns an instance of the context tool. Some tools may simply return >> * themselves from this method others may instantiate new objects >> * to hold the per-request state. >> */ >> public Object init(ViewContext context); > -1 > you know, i've never really been comfortable with this. To me "init" > implies that we are using the method to configure the object the method is > called on, but at present, this method is being used as a factory method to > create new instances of the implementing class. That is to me a misnomer. > I would prefer calling such a method "getInstance" or something similar. That's a good point! getInstance() is much more intuitive. >> /** >> * Allows a tool manager to check if a tool is all static or >> * not. If a tool is not all static, a new instance *must* be >> * created for every template that is processed. If a tool is >> * all static the tool manager *may* optimize the tool handling >> * by working with a single instance for the entire runtime. >> * >> */ >> public static boolean isStatic() >> > > -1 > ick! i don't see the point of this. if a tool is completely static, it > shouldn't be implementing the ContextTool interface. my understanding is > that ContextTool is for tools that are request/session/application > sensitive. if a tool is static, it has no use for such stateful objects and > therefore it is a waste of time to implement ContextTool or anything else. > the view servlet should just use the same instance of static tools for all > requests. You are basically saying that the default behavior of a tool manager should be to treat a tool as static unless it implements some interface that tells it otherwise. That's a possible approach and seems reasonable for all tools I can think of a the moment. The other aspect of a tool is if it can log or not. Maybe we should treat this independently of the static/non-static aspect. Gabe > > [snip] > > Nathan Bubna > [EMAIL PROTECTED] > > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > -- -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
