Re: [Cgi-session-user] proposed refinements to load() and find() interfaces
Brought to you by:
sherzodr
From: Mark S. <ma...@su...> - 2006-06-10 19:15:36
|
On Sat, Jun 10, 2006 at 01:47:18PM -0500, Matt LeBlanc wrote: > On 6/10/06, *Mark Stosberg* <ma...@su...> wrote: > > "load" vs "_load" is not clear. > > load is part of the documented public interface, _load is not. This is a > change to internals, nothing else. I understand. Still, having two names that are nearly identical can be a sign that something is amiss, and is confusing for those who maintain the code. In this case, this difference is basically whether the ATIME gets updated. I'm suggesting keeping one load() routine, and adding a "update_atime" option, which we could possibly leave undocumented, since as far as we are aware, it will only be turned off in one place interally, by find(). > The point of the change that I'm making is to allow us to inspect the > session as the user has left it without changing anything. I strongly > feel that the current behavior of find is wrong. find is supposed to > manage the sessions as the user has left them. I like the change to not have find() modify ATIME. > I wouldn't mind coding them if I agreed with them =) Fair enough. I don't mind leaving out the update_atime option to find, since you feel strongly about that. Here's another refactor: 1. Leave things generally alone with load(), but add extra param, for internal use only, just be clearer than load/_load load($dsn,$query, \%dsn_args, $update_atime); 2. Leave find() mostly alone as well, and don't add update_atime flag. Back out the coderef_args option patch in favor of documenting how to use a higher order function for this. find( $dsn, inspect( look => 'closely'), # will return a code ref \%dsn_args ); Better? Mark |