[V4MD] pointer at the same table by binary_link

Sims, John ayu8 at cdc.gov
Fri Sep 16 14:50:18 CDT 2005


> -----Original Message-----
> From: valentina-beta-bounces+ayu8=cdc.gov at lists.macserve.net 
> [mailto:valentina-beta-bounces+ayu8=cdc.gov at lists.macserve.net
> ] On Behalf Of Ruslan Zasukhin
> Sent: Friday, September 16, 2005 12:29 PM
> To: valentina-beta at lists.macserve.net
> Subject: Re: [V4MD] pointer at the same table by binary_link
> 
> On 9/16/05 4:24 PM, "Sims, John" <ayu8 at cdc.gov> wrote:
> 
> > Ruslan,
> > 
> > I believe we had this dicussion before.  I believe you must 
> consider 
> > the intention in these situations.  When linking 2 records, the 
> > intention is to have the 2 records linked together.  If they are 
> > already linked together, then your intention is already met and 
> > Valentina should just continue on.  If you unlink 2 records, the 
> > intention is to not have the
> > 2 records linked together.  If the 2 records were never 
> linked in the 
> > first place, then your intention is already met and 
> Valentina should 
> > just continue on.
> 
> So you vote for NOT-throwing error here ?
>  
> I not agree John.
> 
> Look e.g. How works API of any OS when you try to open file 
> which is already opened. Or close already closed file. OS 
> return you error.
> 
> If you try marry already married people then you have some 
> logical mistake.
> Before you marry them government at first make sure that both 
> are NOT married at all on this moment. Right ?
> 
> > I believe that throwing errors in the situation where you 
> are trying 
> > to link 2 records that are already linked or trying to unlink 2 
> > records that were never linked in the first place is going 
> to result 
> > in a lot of error handler overhead that will be just there just to 
> > trap the error and move on.
> 
> > I thought this was the reason you created Link.LinkExists for 
> > situation where developers wanted to check for the link before 
> > proceding...
> > 
> > If myLink.LinkExists(a,b) Then
> > msgBox("Link Exists")
> > Else
> > myLink.LinkRecords(a,b)
> > End if
> 
> Absolutely right !
>  
> > MUCH!!!! Faster resulting application than one that uses 
> Error Handlers.
> 
> You worry that exception will slow down your app ?
> But if you have check that link not exists you will NOT get exception.
> 
> And at least in C++ world, try - catch() block Do not slow 
> down app at all until exception happens.
> 
> So you can write:
> 
> try
>  If myLink.LinkExists(a,b) Then
>  msgBox("Link Exists")
>  Else
>  myLink.LinkRecords(a,b)
>  End if
> catch
>   ...
> end
> 
> With no problems...
> 
> 
> > Sorry I am late to the discussion, I was out of town.
> > -My 2 cents
> 
> --
> Best regards,
> 
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
> 

Hi Ruslan,

I do understand your point, but I believe we are talking about Mantis
item #754?  I thought we had resolved this before.  I guess I just don't
consider the process of trying to link 2 records that are already linked
as an "error" as long as Valentina isn't creating duplicate links.  To
examine further, let me take your examples...

On some OS's, I can open the same document more than once.  The problems
that will occur will happen if I try to modify the document in one open
copy while the other is still open.  This, of course, could cause
corruption.  In the case of Links, I don't see where Valentina ignoring
a request to link 2 records that are already linked or unlinking 2
records that were never linked would cause any issues like this.

As for 2 people getting married, people renew their vows all of the
time.  It doesn't matter to anyone that they are already married.  No
one throws up a red flag saying "wait a minute, you're already married".
:-)

As for...

 try
  If myLink.LinkExists(a,b) Then
  msgBox("Link Exists")
  Else
  myLink.LinkRecords(a,b)
  End if
 catch
   ...
 End

This makes perfect sense, of course, but if I'm checking to see that the
link exists first, I should never get the error you are talking about
raising.  So, now I have added 4+ lines of code that are really
un-needed.  Unless there is some more serious error, the above code
and...

If myLink.LinkExists(a,b) Then
  msgBox("Link Exists")
  Else
  myLink.LinkRecords(a,b)
  End if

Would be equivalent.

Now, if we consider my personal viewpoint of "if the records are already
linked, great!!! We have accomplished our task, let's move on" then my 1
line of code...

myLink.LinkRecords(a,b)

Becomes 3 lines of code...

If myLink.LinkExists(a,b) = False then
	myLink.LinkRecords(a,b)
End if

To protect against an exception being raised.

Shoot, I read through all of this and I just sound like a big whiner.  I
hate when that happens.  Sorry.  I can/will certainly work within
whichever decision you make regarding this matter.  I just wanted to
share my viewpoint.

Thanks, as always, for listening to us!

-John


More information about the Valentina-beta mailing list