From: <ke...@su...> - 2003-07-15 22:50:49
|
We probably could and should deprecate all the context tools that don't use the context in favor of functions. However, the "context-aware" tools like $Form, $Request, etc are still quite useful. To give a concrete example of a custom tool that uses destroy(), we created a ResultSetIteratorTool that can take a SQL expression and return an Iterator that wraps a ResultSet. The tool has to close the ResultSet and release the connection when the request is done. (I realize this is not the preferred aproach for a Web application, but it works great for our desktop app.) I can see similar applications requiring other resources, like files, sockets, HTTP connections etc. So what's the best design for doing this sort of thing? The listener approach is appealing because then only tools that need this functionality would register themselves, so very few listeners would actually be managed. Plus this is analogous to the model used by HttpSessions and ServletContexts. Is the overhead really that great? I suppose an alternative is to put the onus on the Servlet developer to handle the cleanup if they want to use these kinds of tools. WMServlet makes a call to a stub method called destroyContext() after each request. A developer could use a method like this to go into the context and find resources that need to be released. This is more work for the developer, but since this isn't used much, it might make sense to do it this way. Keats -------Original Message------- From: Brian Goetz <br...@qu...> Sent: 07/15/03 05:47 PM To: ma...@an... Subject: Re: [Webmacro-devel] More pruning > > >Well FWIW I think nuking CTs is probably a good idea too, if we can still >get the same $Form functionality etc. > >I've never used a CT, and when I eventually understood the difference >between a CT and an app-supplied helper, I couldn't really see how useful >they are except for saving a few lines of code. They're like functionality built into the context that you don't have to explicitly put there. That's pretty useful, and it allows sites to extend WM on their own by building their own tools for their own specific stuff and having it appear "built in." I personally don't use them often, but I can see how they are very useful. I don't see that nuking them will gain us much. At this point, their impact on the code and on performnace is minimal, and people DO use them. We can encourage people to use global functions instead, now that we have them. -- Brian Goetz Quiotix Corporation br...@qu... Tel: 650-843-1300 Fax: 650-324-8032 http://www.quiotix.com ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ Webmacro-devel mailing list Web...@li... https://lists.sourceforge.net/lists/listinfo/webmacro-devel > |