RE: [PEAR-DEV] Re: My contribute do DB/common.php - getMany()
| From: | Lukas Smith | Date: | Wed, 10 Jul 2002 14:06:03 +0000 |
| Subject: | RE: [PEAR-DEV] Re: My contribute do DB/common.php - getMany() | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-7635@lists.php.net to get a copy of this message | ||
Well I am not doubting that your method has its uses.
I am just saying that there is a steadily growing number of methods that
don't really add any functionality to PEAR DB/MDB.
So it would make sense to maybe have a set of functions (yeah
functions!!! Since it does not always have to be an object) that do all
the methods calling.
Anyways I am not talking about your contribution specifically but more
in general.
Best regards,
Lukas
> -----Original Message-----
> From: Johann [mailto:programisci_listy@murator.com.pl]
> Sent: Wednesday, July 10, 2002 3:55 PM
> To: Lukas Smith
> Cc: pear-dev@lists.php.net
> Subject: [PEAR-DEV] Re: My contribute do DB/common.php - getMany()
>
> On 10 lipca 2002 at 14:59:33
> Lukas Smith <smith@dybnet.de>
> wrote:
>
> > Well this is yet another "high level" method that does not add any
> > functionality but safes a bit of work for a programmer.
>
> Paging results is a very common task for web programmers. I am using
> getAll(), getOne() very often to became my code shorter and simpler.
>
> Many programmers need paging capabilities and there was no easy
> high-level solution for PHP. When I looked at excelent abstract of
> Python API I found it has very simple solution. It has cursor with
> methods fetchOne(), fetchAll() and fetchMany(). PHP has similar
> getOne(), getAll(), but no getMany(). So it seems logical to add it.
>
> > I did some fairly crude testing and it seems like these types of
methods
> > don't really add much overhead. They do however make the API larger
and
> > mean that more code needs to be maintained (although these type of
> > methods don't need all that much more since they are the same for
all
> > RDBMS).
>
> If we do not want to increase code, older getAll() method can be
> removed with my method which is more universal.
>
> > The question is more if we want more of these methods to be part of
PEAR
> > DB/MDB or if they should be moved to a separate package.
>
> For backward compatibility it would be better to leave it as
> they are.
>
> --
> Johann
>
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php