[V4RB] 3 simple [?] questions

Keith DeLong delong at redcort.com
Wed Feb 26 08:01:14 CST 2003


Hi Frank,
> ...
>> It's really much better to use cursors:
>> 
>> d.totalseconds = cursor.doublefield("MyDate").value
>> cursor.add   //or cursor.update
> 
> ...
> 
> Short question: Why? What's wrong with BaseObject.AddRecord?

In my thinking there are two reasons:

First, it is a safety issue. All parsing or populating of a record happens
at the cursor level apart from the actual base object. This allows me to
spend as much time as required with the cursor without concern for the
actual db should a crash or other unforeseen event occur. When I'm done with
my record manipulation, an add or update then becomes a single interaction
with the cursor actually writing to the table itself 'all at once'.

Second, for version 2 (with a client/server model), it's vital. Abstracting
all db manipulation to cursors rather than direct access to the tables will
make moving a project to a client/server model much, much easier.

Ruslan (or anyone else) please feel free to correct me if I'm wrong :)

Keith



More information about the Valentina mailing list