INFO PURE API STYLE SCRIPTING AND SCRIPTING LANGUAGE

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Thu Oct 4 06:50:24 CDT 2012


On 10/4/12 1:46 PM, "sandro at wiseidea.it" <sandro at wiseidea.it> wrote:

Hi Sandro,

> Hi Ruslan,
> I read with great interest your article "Choosing a Style of Coding" but I do
> not understand this point:
> 
> Disadvantages
> " The main disadvantage of the Pure API style compared with the SQL Style of
> coding arises when working with a remote server. Using the SQL Style programs
> send small string-based commands to server and the remote DBMS can do a lot of
> work to provide the requested result. With the API Style developer must obtain
> and operate on potentially large intermediate results in the client computer
> which can result in the network becoming a significant bottleneck.
> On the other hand, given a fast high-bandwidth network connection the API
> Style still can be used quite effectively; especially since fast modern
> networks can often be faster than accessing data from a slower local hard disk
> drive. "
> 
> 
> What do you mean? that API style can not be used in queries to a remote server
> (Web)? So I have to use SQL?

Technically it works.

But if server is really remote - e.g. In other city or even country,
Then with sure most tasks will be slower than SQL way.
Because it needs send many small commands to vserver and get results back.

If vserver is on localhost, or on some near computer linked by fast Ethernet
then it still can be okay ...


In fact this is where from was born idea of NoSQL.
Many misunderstanding or myths here between developers in this area,
I think ...


 
> Another question:
> in this article you say that the object-oriented languages ​​work better with
> Valentina but could you explain more clearly or with examples the limits or
> problems of a language like LiveCode combined with Valentina?

LiveCode has two major drawbacks working with Valentina (as well as with
other dbs).  

1) it is not OO, so we was need provide just set of procedures. You have see
that.  We did names as
      VCursor_FieldWithName( cursObj, FieldName )  -> VFieldRef

While in OO style this could be

  class Vcursor
  {
                     Field( Name ) as VField

  }


So Livecode developer need SELF to be very careful with this first
parameters of functions that play role of Object Reference.

We have add a lots of protection code into V4REV to check this values in
DEBUG MODE...


2) LiveCode, yet from Hypercard, internally all use as strings.
   when something come into V4REV, there is no numbers.
   there is strings.

  and we need convert this back and forth.
  This slow down in about x4 times in hot loops.

On the other hand do not be scared, not each app have such hot loops at all.



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