Re: Interest in data-type class for location / address?
| From: | Brett Bieber | Date: | Thu, 31 Jul 2008 18:00:51 +0000 |
| Subject: | Re: Interest in data-type class for location / address? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50500@lists.php.net to get a copy of this message | ||
On Thu, Jul 31, 2008 at 12:03 PM, Philippe Jausions <pear@11abacus.com> wrote:
> Hi All,
>
> I'm looking for input for a package that would deal with locations and
> addresses in a generic manner for PEAR packages. The idea would be to
> have an interface (and class reference implementation) to handle
> location-related data such as street address, country, region code, post
> office box, poste restante status and so on.
>
> Such class would allow to easily pass data from one package to the next.
> For instance, a vCard could contain such location instance for an office
> address which we'll be able to simply pass on to Payment_Process package
> as a billing address.
>
> I'm also working on other related packages to validate mailing addresses
> against some web services, such as the US Postal Service. Such location
> instance could also, of course, be passed to shipping related packages
> if needed; I understand Kristopher Ives is working on a
> Services_Shipping package.
>
> Since this kind of data is rather used often, wouldn't it make sense to
> have a dedicated package for it?
>
> For my own usage, I've already started putting something together, and
> you can review it here:
> http://pear.11abacus.com/package/Structures_Location
>
> Note that it's far from complete, and it's especially missing a
> formatter class.
>
> Since there are a lot of idiosyncrasies for each country, a
> multi-cultural community such as PEAR should greatly help with ironing
> out details.
>
> Let me know what you think. Thanks,
Sounds good... I have a lot of use for something like this.
My only request would be a little more abstract thinking about the
term 'Location' - in some instances this may not always refer to a
location you can ship a package or mail a letter to.
For example, a location may be simply - a greenspace/park, the park
fountain, the apex of a mountain, a geo-cache etc. I see that you have
getGeodetic etc, but also getStreetAddress etc. I would suggest some
restructuring to handle some of these details in separate classes.
class JohnDoeAddress implements Shippable, StreetAddress, PersonalResidence
class GreenSpace implements SpatialData, LatitudeLongitude
--- this represents some short sighted thinking about the issue, but I
think this should be considered before assuming any location has a
street address.
With that said - Philippe, this sounds like a very good idea - along
with the formatters for vcard etc.
--
Brett Bieber
http://saltybeagle.com/