RE: [PEAR-DEV] Duplicating code between packages.

From: Date: Fri, 13 Jun 2003 08:19:02 +0000
Subject: RE: [PEAR-DEV] Duplicating code between packages.
References: 1  Groups: php.pear.dev php.pear.qa 
Request: Send a blank email to pear-dev+get-17378@lists.php.net to get a copy of this message
> From: Peter Bowyer [mailto:peter@mapledesign.co.uk] > Sent: Friday, June 13, 2003 12:14 AM > In the Image_Transform NetPBM driver I need to use two of the methods from > the file package (getTempFile() and getTempDir()). Should I include this > package in the code, creating an extra dependency and adding another 500+ > lines of code, or should I instead duplicate these two methods in my > driver? If I was using C I'd do the former, but for PHP is the latter > better? Generally dependencies should be kept to a minimum. Code duplication is a risk we are willing to accept because if this. However please take care when you do this sort of thing. Watch the commits to the other package to ensure that fixes get merged over. Also think about the future of your package. If you envision that more things will be used in the future it might make sense to put in the dependency. Anyways I think there are a lot of cases where the file package code was copied for the exact same reasons, just something to think about in the future. It might be a good idea if we could create a table of these sort of "dependencies" (copied code) for future reference. Regards, Lukas

« previous php.pear.dev (#17378) next »