2009/7/19 MEM <tal...@gmail.com>:
>> I don't know how your other classes are arranged,
> myPDO.class.php -> Singleton. Makes the connection to the database possible.
> generalDAO.class.php -> Abstract DAO Class, grabs the myPDO instance and 
> could have other methods on the future that are shared for all the DAO 
> classes.
> AnimalsDAO.class.php -> DAO class with insertAnimal(); deleteAnimal(); 
> updateAnimal(); countAnimal(); selectSpecificAnimam() methods...
> The same goes for the VetDAO.class.php.
>> but personally I'd
>> build pagination into a class that provides raw data access, then
>> inherit that for specific types of data like animals. Efficient
>> pagination is too tightly coupled to the data source to be separate.
> According to the above, does this suggestion of yours still apply?
> If so, what is the buzzword that I should look at so that "inherit that for 
> specific types of data like animals" could be possible? What/where should I 
> look/search to accomplish your suggestion?

I would say your pagination logic belongs in myPDO.class.php. Where I
have this functionality it's as simple as two arguments to the method
that gets data, $page and $perpage. Setting both to false would
retrieve all rows.



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

Reply via email to