Re: Newbie: Composition by Association - Pagination Class general question.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2009/7/19 MEM <talofo@xxxxxxxxx>:
>> Pagination is the generically applicable class - it should know
>> nothing about what specifically it's paginating.
>
> Ok... but I need to grab values of my DAO classes, I mean, even if we paginate images on a directory or records on a database table, the pagination should have a $limit, and a offset, a way to count how many item there are to work with... So it must be related with the DAO (or other thing) on some way, so that I can grab those values and play with them on the pagination class...
>
> Should I use a Decorator Pattern to make this relation between the pagination and the DAO ?

I don't know how your other classes are arranged, 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.

-Stuart

-- 
http://stut.net/

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux