[cad-linux] Re: database access methods

  • From: Eric Wilhelm <ewilhelm@xxxxxxxxxxxxx>
  • To: cad-linux@xxxxxxxxxxxxx
  • Date: Thu, 15 May 2003 23:24:49 -0500

> The following was supposedly scribed by
> Brian Johnson
> on Thursday 15 May 2003 09:00 pm:

>Maybe it's that I'm not a programmer, but I can't understand why an access
> library is required for any and all access to the db
>If I were writing an app that would do some simple queries to the db, and
> the data I wanted was in an easy to access format in the db, I would not
> use an access library if a direct SQL connection were possible.

Sure, if you know where to look and what the information means, but when you 
need to poll the database for the results of parametric relationships, 
wouldn't it be easier to access with something like:
        *attachment_point = get_location(door, *levels, type);
        length = trace_wire(circuit, *extents);
and etc. than to read each of the relationships (conduit connects to bracket, 
bracket connects to beam, beam connects to column, etc, etc) and construct 
the length of wire or determine how the door is hung in the frame?

>Same with writes to the db if my app were creating it's own tables within
> the project db for data not available elsewhere in the db.  

Why would your app be creating its _own_ tables in the project db?
This is contrary to the purpose of the system, which is interoperability.  
Does your app do something that no other app in the world can do or produce 
data that wouldn't be useful to any other app in the world?

> ie I wouldn't
> write an app specific access library to reproduce what is already available
> via SQL

I'm not talking about reproducing the functions of SQL, I'm talking about 
implementing a standard method of storing and sharing data in a well-defined 
and structured way which would be readily available for use by any developer.  
If you are going to include some SQL code in your program to access the data, 
why not just use a set of functions from a library meant to access that data?

Furthermore, if you are going to _write_ to the database, every other program 
utilizing the system will greatly appreciate it if you do it according to the 
standard.  If that standard is defined by the access library, you don't have 
to worry about implementing the standard correctly, just use the library.  

More importantly, the other apps don't have to worry about you implementing 
the standard correctly iff you use the functions in the library.


Other related posts: