RealBasic Data Manipulation "Best Practices". . .?
Michael Williams
mwilliams at mgreg.com
Wed Jun 27 06:12:01 CDT 2007
> On 27/6/07 4:00 AM, "Michael Williams" <mwilliams at mgreg.com> wrote:
>
> Hi Michael,
>
> I recommend subscribe to Valentina list and ask such general questions
> there. Some other Valentina developers can be in help faster or
> more useful
> of me. :-)
> Can I ask few questions to better help?
>
> 1) what is your db experience?
>
> did you work before with SQL?
>
> What dbs?
>
> Do you know Relational Model?
>
Yes, Ruslan, I've been working with databases (and various other
storage formats) since the mid-90s. I've dealt extensively with SQL
and data serialization, etc. Since RB neither implements interfaces
for OR Mapping nor Serialization I decided to try Valentina since
everyone is raving about it.
I don't necessarily believe that SQL is evil, but I'd much prefer to
access my data with dot-notation these days (e.g. RoR). I was hoping
that you all had written some low level code to allow data binding/
mapping at a higher level.
>
> 2) Did you read this sections of docs:
>
Yes, I believe I've read about 70% or so of what's there. None of it
seems to be what I'm looking for
> 3) So you do not want SQL. You will use LOCAL db ?
> if you plan even use a remote Valentina Server with this project,
> then better to use SQL way
>
No, if I were going to use SQL, I'd simply stick with RB. Most of
the programs I write will have less than 50,000 records. I'm just
looking for something that allows me to access the data more easily
programmatically.
>
> 4) so if you decide to use non-SQL way, then you still have 2 choices
> described in above ARTICLES section.
>
> a) API Way
> b) Class way
>
> Which one is better for you?
>
Neither really. I mean, I suppose the API method, but it still
doesn't seem to provide what I'm looking for.
>
> 5) Well, syntax as
>
> INVOICES(1).INVOICE_ITEMS
>
> Is look similar to Ruby On rails framework. And is tooo high level.
>
> What should be returned as result of this line? SET of RecIDs ?
>
Yes, that's exactly what I'm looking for. It should return an array
of objects:
LINE_ITEMS = INVOICES(1).INVOICE_ITEMS
LINE_ITEMS(1).PRICE = $1
LINE_ITEMS(1).SAVE
. . .*that* would be worth twice the current price for me.
>
>
> 6) examples of table you have made are in RELATIONAL MODEL!
> you use id as integer, ...
>
> Do you want use Valentina's RecID, ObjectPtr, binaryLink?
>
Hrm, I guess none of them. Some of these seem to perform well and
allow you to take up less space in the DB, but those really aren't my
interests. Ultimately I suppose I'm looking for Object-Relational
Mapping. Folks keep directing me to Valentina, but I suppose it may
not be what I need.
>
> 7) in V4RB code may looks as:
>
>
> MyDatabase
> tblInvoice = ...
> tblInvoiceItem = ...
> tblClients = ...
>
> End
>
> Later in code:
>
> Invoice_RecID = 1 // some record of invoice
>
> setInvoiceItems = tblInvoiceItem.fldInvoicePtr.Find
> ( Invoice_RecID )
>
>
> Or using Vlink class the same can be done as
>
> setInvoiceItems = linkInvoiceItem.FindLinked(
> Invoice_RecID, tblInvoice, tblInvoiceItem )
>
>
That still seems like a lot of setup.
Thank you for your replies.
Regards,
Michael
More information about the Valentina
mailing list