Chemistry Reference
In-Depth Information
The following suggestions may help design and implement a better
system for a project needing a client interface.
Try to use SQL as much as possible.
Consider extending SQL with new functions.
Do not implement the same functionality in different clients.
Only transfer data the user needs to see.
Make good use of existing libraries.
Try to use SQL as much as possible. There are many useful features of
SQL that can do much of what is needed when handling sets of data. For
example, it would be wasteful to have a client program request an entire
table in order to select certain rows. The SQL select statement is designed
to efficiently search rows of a table. SQL can also sort selected rows using
the order clause. When it is necessary to combine results from different
queries, consider using the set operations of SQL, such as intersect and
union rather than combining selected sets in the client program. There
are other less obvious ways of using SQL to compute results. For example,
the method used to compute polar surface area described in Chapter 8
makes use of SQL's ability to join tables and sum data in chosen columns.
Not every computational chemistry method is amenable to use with SQL.
For example, it is unlikely that a quantum mechanical energy could be
efficiently computed using SQL compared to using a client.*
Consider extending SQL with new functions. This might be consid-
ered the fundamental suggestion in this topic. There are many useful
functions built into SQL, but sometimes a simple extension function can
allow an SQL operation to run completely on the database server without
having to pass data to the client. For example, to sort selected rows by and
value in a column requires only simple SQL. If the data needed to sort the
rows is not part of data being selected, consider writing a function that
will provide the value to be sorted. For example, if it were necessary to
sort by the number of atoms in a molecule, a natoms(smiles) function
could be used in the order clause of SQL.
Do not implement the same functionality in different clients. If many
different clients require the same functionality, it is better to encapsulate
that in one central location—namely the RDBMS. For example, if it is nec-
essary to compute molecular weight, it is better to have a server-side func-
tion do this in a consistent way rather than to implement such a function
in each of the languages used for client applications. This may be more
obvious for functions like fingerprints that are more difficult to re-imple-
ment in various languages. Moreover, it is essential that fingerprints be
* Since SQL join bears many similarities to matrix multiplication, this is not as crazy an
idea as it may sound.
Search WWH ::




Custom Search