|
Posted by Jerry Stuckle on 12/24/68 11:46
ImOk wrote:
> Mladen,
>
> I agree about your assesment about the myth of database independence
> and each DB engine has its own specialties.
>
> My requirements are simple:
>
> - Use SQL Server or MySQL
> - No triggers (will be done in code)
> - Minimal in application engine configuration (will be done in
> configuration files).
> - No relational management (will be done in code).
> - Transactions/Commit/Rollback.
> - Portability to Linux (MySQL).
> - Simple datatypes.
>
> I am just looking for people's experiences with these 2 extensions as
> far as performance.
> What would you say is the best extension to use between DB or PDO given
> my simple requirements?
>
> Thanks
>
I don't have any experience with these extensions. My philosophy is a bit
different.
I'll build layers of classes. The database layer contains the database-specific
calls (i.e. mysql_query). The next layer is the tables, which are derived from
the database layer. Simple one-table SQL statements go in here. On top of that
are the business objects, which communicate with the one or more table objects
to communicate between the tables and my program. I'll have multi-table SQL
statements here.
If I need to change databases, I just need to change the top layer - one class.
If I need to change the table layout, I have to change the table layer, and
probably some in the business object layer.
But any changes in the database are completely isolated from the web pages
themselves.
Simple queries result in relatively simple classes. I admit there are problems
when I get more complicated queries, but I'd have the same complications anyway.
This way I keep everything outside the web page code. And changes are limited
to a few classes instead of dozens or potentially hundreds of pages.
I admit this would be a lot of extra work for a small site. There you could
combine the table and business layer objects. But you still have database
independence and no SQL or other database specific code in your app.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|