[V4RB] binarylink concept question

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Aug 22 08:58:28 CDT 2005


On 8/22/05 12:58 AM, "Peter Salomon" <peter.salomon at gmx.net> wrote:

>> Left right? But how you can remember (know) which table is on left
>> or right
>> for THIS link ?
>> 
>> This is why we ask you EXPLICITLY show tables.
>>     - Never mind which one is left right.
>>     - you solve some task. You think:
>>         I have persones, I want find phones...
>>         so:
>> 
>>         res = FindAllLinked( person, phones )
>> 
>> No way to make a mistake. :-)
> 
> :-) no?
> 
> ok. what if i think:
> 
> "I want phones from person!"
> (like one is used to think from sql)
> 
> You see, also with the acual way you differ between the tables by
> definiton which is the 'i_have_table' and which the
> 'i_wanna_get_table' .
> 
> And the definition is: 'i_have_table' is on the left side, 'i-
> wanna_get_table' is on the right side.

But you also can think in the next function:
        I have phone, I want find linked persons
 
> And if í have named my links  in a useful way like "LinkTblA_TblB" i
> know very well where my tables are and have no need to remember.
> So - just by defining the sides, link ca do its job.

Peter, but Link can work in both directions !!!
 
> Moreover i need to remember the poistions of tables also for defining
> the links!

> LPersonPhones = new VBinaryLink("LinkPerson_Phones", TblPerson,
> TblPhones, EVLinkType.kOne,EVLinkType.kMany)
> 
> Recs(0) = 1 <------- TblPerson
> Recs(1) = 1 <------- TblPhones

> LPersonPhones.LinkRecords(Recs)
> and now again:  res = LPersonPhones.FindAllLinked( TblPerson,
> TblPhones )

This is true. No way make this simpler.
May be only to have LinkRecords() with 4 parameters. But this is bad.
 

> i was just wondering ruslan, if LPersonPhones.FindAllLinked( ) would
> be enough?

> because it seems to me that i tell link its tables twice which is -
> in my opinion - one time too much.

Again and again. This function can work in 2 directions and return 2
different results. 

MAY BE it is possible to use default parameters, so if you NOT specify them,
then func works left -> right in direction.

> hey - links work well the way they are, its a discusson about
> cosmetic questions...

I understand this.

> there might also be other reasons, i did not think about other
> linktypes yet.

Your ideas are welcome

-- 
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