Question Backlog for Valentina mailing list.
Ruslan Zasukhin
sunshine at public.kherson.ua
Wed Nov 16 08:57:14 CST 2005
On 11/16/05 8:45 AM, "Ed Kleban" <Ed at Kleban.com> wrote:
Hi Ed,
>>>> * Valentina 2 also have new link -- BbinaryLink. This is not a field at
>>>> all.
>>>>
>>>> Methods of Vlink class work for ALL link kinds. So it needs write text in
>>>> general form.
>>>>
>>>
>>> Yes. I understand and agree. First I had to understand what it did. I
>>> could
>>> write something that would serve all cases now. I very much like
>>> the concept of the Vlink; making the links be an instantiated abstraction
>>> is very cool.
>>> --Ed
>
> Well, I take that back. I clearly don't understand. Last night in bed I
> started wondering:
:-)
> "I wonder if there's a way to simply use a byte-wide field as you would use
> an ObjectPtr field if it is known in advance that the linked-to table will
> never have more that 255 records? "
YES. Then you get old good FOREIGN KEY. And this still is VLink.
> Then I thought, "Hmm. maybe that's what Binary Links can do if you create a
> link between a byte-size field in one table with the virtual RecID field in
> another table."
NO. BinaryLink always use RecID values.
> But I just now read all the doc in both the Kernel and RB Reference about
> Binary Links and decided I don't have a clue about what they do or how to
> use 'em.
They do effectively the same as you do in Relational model with help of
third Table to establish M:M link.
What do this table? It just remember pairs (id1, id2)
BinaryLink do the same, but use RecIDs and it is NOT a table.
It is more effective structure.
> Specifically: The constructor VBinaryLink takes as arguments a pair of
> tables, and some referece ("power") , deletion, and storage arguments -- but
> has no field arguments.
Right. Because always RecID are used.
ObjectPtr also do not use "field" of pointed table. Remember?
Only Foreign KEY need field.
> So my conjecture that it could relate specific
> fields was clearly wrong, that's not what it does, nor is that what the
> documentation says it does. In fact as the doc clearly states it doesn't
> require field allocations.
right
> So I guess I'm stuck. I don't understand these critters. I understand how
> to create a binary link with VBinaryLink(...), but I don't know how to use
> the link once I have it. How do I tell the link, or how does the link know,
> which records in Table A correspond to which records in Table B, or vice
> versa?
simple:
link.Add( tblA.RecID, tblBRecID )
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list