The DBI Module is an
incredibly useful tool because it abstracts away the
need to learn how to communicate with every type of
database out there. Consider what a pain it would be
if you had to write a CGI script for every
proprietary database engine.
Now imagine how much extra work you would have if the management
decided to change database vendors on you after you had
already written your code!
What the DBI module does for you
is to provide a single interface to send SQL commands to any proprietary
database. Essentially, you write all your code to a generic
standard, and move it from database to database without
having to re-code your application.
The secret to the DBI module is
the extensive library of DBD (Database Dependent) modules that come
with the standard distribution of Perl 5. These DBD modules
provide the code that hooks up DBI to a proprietary database driver.
Of course, since these DBD modules are already written for almost
any Database you would consider using, you needn't do any
of that hard work. All you need to worry about is satisfying the requirements of the DBI
interface. Everything else is handled behind the scenes!
![[Spacer]](Images/dot_clear.gif)
|
It looks pretty complex
but believe me, it isn't. And it makes your life as a programmer incredibly easy. That is, although the communication
takes place through so many actors, you, as the programmer need not bother
with the details of that communication. You talk to the DBI module, and
the DBI module handles the multitude of proprietary database blue meanies by
itself. |
Fortunately, dozens of great module writers have done all that hard
work for you. You'll see just how easy it is when we
start going over code!
Previous |
Next |
Table of Contents
|