RE: [PEAR-DEV] OO wrappers (was : Need 1 more vote for Image_IPTC class)
| From: | Lukas Smith | Date: | Tue, 08 Apr 2003 14:45:41 +0000 |
| Subject: | RE: [PEAR-DEV] OO wrappers (was : Need 1 more vote for Image_IPTC class) | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-15034@lists.php.net to get a copy of this message | ||
> From: Xavier Noguer [mailto:xnoguer@rezebra.com]
> Sent: Tuesday, April 08, 2003 4:38 PM
> El Mar 08 Abr 2003 10:09, Lukas Smith escribió:
> > > From: Xavier Noguer [mailto:xnoguer@rezebra.com]
> > > Sent: Tuesday, April 08, 2003 4:02 PM
> ...
> > > In my opinion PEAR packages shouldn't use wrappers. It's one
thing to
> > > create
> > > an OO wrapper so that people have more choices for using a certain
> > > functionality, and another one to force anyone using a different
> > > functionality to have to deal with the overhead of that wrapper.
> >
> > So you prefer a CS mix?
> > Especially if these classes are extended we get huge problems with
> > naming conventions. Actually as the core of PHP becomes more and
more OO
> > friendly we will find ourselves often in this situation (see the
> > Exception class Sterling is writing). Then we might as well through
the
> > PEAR CS out the window now.
>
> I'm not following you. I don't see how:
Maybe I am not following that Rasmus and you are saying either :-)
> $foo = new Foo();
> $foo->bared();
>
> is better than:
>
> $foo = foo_create();
> foo_bared($foo);
>
> I'm talking about plain wrappers, wrappers that don't add any
> functionality
> to the one provided by the original php extension they are wrapping.
I did not look at the details of the class from which this thread
originated, but if I understood the issue correctly this class does add
functionality beyond what the PHP implementation does.
Of course there is no reason to wrap PHP native functionality just to
make everything PEAR CS compatible. PEAR aims to extend PHP and not to
wrap all of PHP functionality into a different API.
But we do run into problems if we extend classes that follow a different
CS.
Regards,
Lukas