RealBasic Data Manipulation "Best Practices". . .?

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Jun 27 03:18:42 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.  :-)


> Ruslan,
> 
> I apologize for bugging you yet again, but after considering a great deal of
> documentation, I'm still having trouble wrapping my head around accessing the
> database and obtaining proper items per relationships using your "Object"
> based API.
> 
> The examples still seem a bit overly complex.  There seems to be a lot
> involved in the setup of tables and their data types, etc.  Below is an
> example of a few tables.  If you wouldn't mind, please provide me the most
> sensible way (I'm guessing something other than SQL) to access the data in the
> tables:
> 
> 
> //pseudo SQL
> 
> create table INVOICES(inv_date as date, id as integer, client_id as integer)
> 
> create table INVOICE_ITEMS(item_id as integer, quantity as integer, cost as
> double)
> 
> create table CLENTS(client_id, first_name as varchar, last_name as varchar)


> . . .that said, how would I use your wowwie-zowwie API to access all
> INVOICE_ITEMS for a specific invoice for display into appropriate fields?  I'm
> hoping for something like:
> 
> INVOICES(1).INVOICE_ITEMS
> 
> Please advise.

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?


2) Did you read this sections of docs:

GETTING STARTED:

http://www.valentina-db.com/dokuwiki/doku.php?id=paradigma:public:en:documen
tation:start:start

A Technical Introduction to Valentina:

http://www.valentina-db.com/dokuwiki/doku.php?id=paradigma:public:en:documen
tation:articles:tect_intro

ARTICLES:

http://www.valentina-db.com/dokuwiki/doku.php?id=paradigma:public:en:documen
tation:vkernel:vlink:vlink


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


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?


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 ?



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?


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 )
 



8) I need say  Hmmm !!!!!

I like idea of above syntax...may be we can find way implement it for V4RB
API also...


At least you can implement it as own RB methods in subClasses of Valentina
classes



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