On Wednesday 16 April 2008 17:35, Bas Scheffers wrote:
> On 17/04/2008, at 9:25 AM, Tom Jackson wrote:
> > Your script/page level code can remain unchanged even when you switch
> > databases.
>
> That looks more like an OR mapping framework. I think that is a good
> thing to have also but to me it is separate from having bind variables
> in the core nsdb api. I would expect any OR mapping tool to build on
> it, rather than emulate it.

You are right this is not bind variables, but is isn't an OR mapping. It is 
more similar to a stored procedure, but at the Tcl level. 

Notice that the OpenACS solution is very compact, as it follows the Oracle 
type of bind variables, that is, the bind variables are 'named'. Because they 
are named, there is no need to bind the variables in order. Besides requiring 
more user level code, you would also have to be careful every time you change 
the query text: if the order of the parameters changes, you have to re-order 
other parts of your code. Also, if the placeholders are anonymous tags 
like '?' or '$1', you could actually have trouble figuring out the 
relationship between placeholder and a local variable.

My particular code uses named queries (just like OpenACS, but grouped into 
namespaces) and explicit parameters. My code requires more user level code, 
but is slightly more flexible, for instance, you could switch from a static 
data source to an SQL data source. But, it is also easier to manage 
transactions. Most important to me is that adding a new database type doesn't 
require editing the code, you just add a new implementation. 

tom jackson


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to