[Valentina] Re: Vdb files
Keith DeLong
delong at redcort.com
Sun Jan 19 18:03:53 CST 2003
Thanks for patiently working through this issue with me this Ruslan -- I
think there's value for both of us.
>>> Now, if you do
>>> db.Create( "dbname.vtc" )
>>>
>>> You must get files:
>>>
>>> dbname.vtc
>>> dbname.dat
>>> dbname.blb
>>> dbname.ind
>>
>> The vtc comes from the 'dbname.vtc' NOT from ValentinaSetExtensions "vtc"
>
> No Keith,
>
> When you do
> ValentinaSetExtensions "vtc", "dat, "blb", "ind"
>
> You inform Valentina that NOW it must think, that ext of Description File
> Must be "vtc"
>
> When you do
> db.Create( "dbname.vtc" )
>
> Valentina use that info to do next string operation
>
> Substr( "dbname.vtc", "vtc" )
Why the Substr at all? Why make create parse a name that you already have a
constant set for with ValentinaSetExtensions?
> As result, Valentina can extract the basic name of database "dbname".
> As result, Valentina can now buld rest names "dbname.dat", ...
This is not a good solution in my opinion. The developer get wild results if
he doesn't set first parameter ValentinaSetExtensions to the same extension
passed when the create command is called.
Here's how it works from the developer point of view. If I want custom
extensions:
1. I must set custom extensions via ValentinaSetExtensions
ValentinaSetExtensions "XXX", "dat, "blb", "ind"
2. I must remember to always append any user supplied name with the same
data file extension supplied to ValentinaSetExtensions.
a. get name from user.
b. add my data file extension
c. db.Create( "dbname.xxx" )
Why the duplicate effort and tracking?
3. If I accidentally do
ValentinaSetExtensions "XXX", "dat, "blb", "ind"
//and then later...
db.Create( "dbname.vtc" )
Your Substr( "dbname.vtc", "XXX" ) leads to:
dbname.vtc
dbname.vtc.dat
dbname.vtc.blb
dbname.vtc.ind
Do you see how confusing this is from a developers point of view? (This is
just what confused me in the first place). I see HOW it happens based on
your explanation above. But it is not at all obvious for the developer.
You're making me match the first parameter of ValentinaSetExtensions with
the extension of the create file name with no error checking or clue what is
happening if I fail to do this.
> I hope now it is more clear.
I understand how it works, but I don't think you've done a good job here.
:-)
It still seems to me it would be so much more straight forward if the create
just received the filename. The Substr( "dbname.vtc", "vtc" ) would go away
and create could simply rely (just like the other 3 files) on the
parameters of ValentinaSetExtensions.
If I'm missing some C++/cross platform logic that I don't understand. Please
forgive me. In this case, I'd request that "dbname.vtc" and "vtc" should be
compared and an error generated if the ValentinaSetExtensions constant
doesn't match the file extension passed to the create command. What a
mess...
We can agree to disagree if you still fail to appreciate any value to this
dialog. Thanks for hanging in there with me :-)
Keith DeLong
More information about the Valentina
mailing list