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

From: Date: Sun, 19 Jul 2009 12:25:07 +0000
Subject: Re: Newbie: Composition by Association - Pagination Class general question.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-295569@lists.php.net to get a copy of this message
2009/7/19 MEM <talofo@gmail.com>: > Hello, > > I have a Animals DAO class that I'd like to apply a pagination class to it. > > Between this two classes, there will be a composition relation (more > precisely, an association one). My question is: > > Is a Pagination that "has a" Animal. OR Is a Animal that "has a" > pagination? > Should we create on Class Pagination a property named $_animal OR, should we > create on class Animal a property named $_pagination? > > I'm inclined to accept the second one, since, if I put the property $_animal > on my classe Pagination, I will end up, on the Pagination Class, with so > many properties as pagination objects... :s Pagination is the generically applicable class - it should know nothing about what specifically it's paginating. -Stuart -- http://stut.net/

« previous php.general (#295569) next »