Re: Package proposal Science_Weather
| From: | (Alexander Wirtz) | Date: | Fri, 22 Aug 2003 12:04:50 +0000 |
| Subject: | Re: Package proposal Science_Weather | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-20393@lists.php.net to get a copy of this message | ||
On Fri, Aug 22, 2003 at 01:36:48PM +0200, Stephan Schmidt wrote:
> Basically I like the class very much, but I'd like to see it renamed to
> Science_Weather_WetterDotCom.
> I don't think that it's useful to go and create a unified interface for all
> services that are available, as they probably won't be interchangeable. I
> guess different services will provide different information and so using a
> distinct name for the class should be enough...
I'm at work right now :) tuupola from pear@efnet convinced me to use a
factoring framework and right now we have
Weather.php
|--|--Common.php
|--Metar.php
|--WeatherDotCom.php
Code is working like
$weatherDotCom = &Science_Weather::service("WeatherDotCom");
$weatherDotCom->searchLocation("foobar");
...
you get the idea...
The interchangeability stops there, where a certain service is not providing
a special datafield, so METAR won't have a forecast for example, but the API
for getting the data is the same.
> If the name is changed, I'm +1 for this package, Coding style is great, PEAR
> dependency could be removed...
done.
The code is already working, I tested them with two example-scripts and I
get the same result like before the rewrite, so maybe I can give you an
overview in a few hours.
Regards,
Alexander