Re: Package proposal

From: Date: Wed, 29 Jun 2005 16:37:03 +0000
Subject: Re: Package proposal
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-38373@lists.php.net to get a copy of this message
christophe blin wrote:
Bertrand Mansion wrote:
Current work : - allow the use of a database to store the units instead of using a file (adding unit will be then more simple and available to end-user)
Useless and bad design IMO, the way Fahrenheit is converted to Celcius is not going to change so there is no need for a database. A simple PHP array should be enough, even for user-defined conversions.
1/ Why would this be bad design to store the informations in the database instead of storing them in a file ? Isn't it the goal of a db to store relationnal data ? Personnaly, I prefer to avoid the file storage because it introduces a lot of problem (permissions, end-of-lines, ...). 2/ I did not say the user can modify the units, I only said the user can _add_ units and this is slightly different... Example: the user want to add the unit "bananas" to allow him counting the bananas he is producing in his farm. He would do so by saying that bananas is equivalent to the unit '1' (which means quantity) then he can use bananas wherever he want to use a quantity.
Chris, I see what you mean, but I think that would enlarge the scope of the package way too much. DB queries are quite expensive when compared to a simple file load. I feel that the way of handling the custom units should be left to programer of the application that package might be used. Otherwise any one choice you make for the package may not be suitable for everybody. Anyhow, this package would be a very good addition to PEAR. Probably named Math_Convert -Philippe

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