RealBasic Data Manipulation "Best Practices". . .?

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Jun 27 09:53:17 CDT 2007


On 27/6/07 2:12 PM, "Michael Williams" <mwilliams at mgreg.com> wrote:

Hi Michael, 

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

In any case you search for API DOT way,

Class way of Valentina is just wrapper around API way.
Article describes this good.

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

Two or N times call  "LINE_ITEMS(1)."  already sounds not good for me :-)

*** ATTENTION ATTENTION ATTENTION ***

Again, please note that REALbasic is not ROR.

Tell me please, if REALbasic language is able support such syntax:

        LINE_ITEMS(1)

? 

As far as I know -- it cannot, because there is no OPERATOR().
So for RB this syntax in any case will looks different.

Lets see what we can invent here :-)

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

And this is WRONG, Michael.

Exactly these 3 features make Valentina *VERY* different from other RDBMS.

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

Exactly these 3 features can help A LOTS develop OR mapping you are looking
for. We have discuss OR wrappers around Valentina with at least 3-4
developers, some was Objective-C, some .NET, and Thorsten has REALbasic OR
framework around Valentina now. And they was happy to see these features.


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

Not very a lots actually.

Because our Vlink class has such methods which you cannot even dream in ROR
:-)

What about reverse task?

     setInvoiceItems = linkInvoiceItem.FindNotLinked(
                                            1, tblInvoice, tblInvoiceItem )

What about tasks when not single record plays but the sets of records?
Ah? :-)

Syntax      


--------------------
And our class way is similar to ROR (or reverse :-) from point of view that
you DESCRIBE tables using API. Usually one line per field.



---------------------
And at the end of this letter. Task you show:

> LINE_ITEMS = INVOICES(1).INVOICE_ITEMS
> LINE_ITEMS(1).PRICE = $1
> LINE_ITEMS(1).SAVE


In Valentina looks as

    INVOICES.RecID = 1
    INVOICES.Price = $1
    INVOICES.UpdateRecord()


Where we loose ????  :-)
 


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