> > As for (1) even in my pre-OO days I was used to using a single
> generic
> > DAO
> > for all database access. The only time that more than one DAO existed
> > was
> > for a different DBMS engine. This is why I have one DAO class for
> MySQL,
> > one
> > for PostgreSQL and another for Oracle. If you are incapable of
> writing
> > a
> > single generic DAO then it just shows that you still have a lot to
> > learn.
> > For an idea on how this works take a look at
> > http://www.tonymarston.net/php-mysql/databaseobjects.html
> I'm absolutly sure that I have a lot to learn. Really a lot. :-)
> I have post some days ago, a way for using a generic CRUD class and DAO,
> but I get no replys so I wrongly suppose that my question was a
> nonsense question, and that CRUD and DAO would be a nonsense.

I'm trying to use PDO with prepare statements and BindParam, so I'm afraid
that my "newbility" doesn't allow me to pass directly from your example to
one that uses PDO.
Also, I also intend to use fetchObject method instead of fetchAssoc quite
often, with also puts your tutorial far away from my capacities. Because of
this, I'm trying to follow what I can get on the web, using PDO and general
CRUD operations:


1) http://oopgarden.richardknop.com/index/view/1

or Here:
2) http://phpro.org/tutorials/Easy-Access-With-PDO-CRUD.html

when we have to create complex querys by using limits, order, etc... either
they are inexistent possibilities (like on the link 2), or, like on link 1
they are so close to the equivalent sql sintax that I'm questioning the
advantage of having a general DAO CRUD class at all (supposing that the only
advantage is that we write less words on the code).

Please advice, besides the fact that we "never have to code any of the SQL
SELECT, INSERT, UPDATE or DELETE statements for any table as they will be
generated at runtime.", is there any other advantage on using a general DAO
class instead of one DAO class for each table?



PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to