[REBOL] Re: dbms3.r 01
From: rotenca:telvia:it at: 15-Jan-2002 2:53
> Earlier versions of dbms.r used blocks instead of objects, but I
> found that not practical. It's not useful to have to remember if
> the row you need (e.g. 'name) is the second or the third in the
> block... :)
Yes but often we need blocks of blocks of data.
There at least three methods to not have to remember positions (you know
column: [name surname email]
data: ["joe" "smith" [joe--smith] ]
set column data
column: reduce ['name pick data 1 'surname pick data 2 'email pick data 3]
transform the block in an object
I think that is the user which must decide it. The database should offer only
a collection (block) of data not a fixed struct like an object which cannot be
extedend without cloning (and the definition of which, it seems to me, is
created by your program at each iteration) and that is not useful with any of
Rebol function which all ask blocks to share data (except a few cases like
face, event, error ...).
To find replace sort a collection of objects is not a direct task.
A block can be easy converted in another datatype! like an hash! for fast
I think also that the layout of object (if it exists) could be defined by user
and dbms should only bind data to the user object. The object interface should
be an option, an additional service.
Object interface is surely useful for db-foreach, but i always think at a kind
of db-select [name surname] [sort by name] which return a block of blocks.