Re: Structured data
| From: | David Sanders | Date: | Thu, 02 Aug 2007 01:41:07 +0000 |
| Subject: | Re: Structured data | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47741@lists.php.net to get a copy of this message | ||
Philippe Jausions wrote:
Hi all, How much sense would it make to have in PEAR some base classes for data structures? Think along the line of Structure_Location, or Structure_Phone. This would allow to not reinvent the wheel for packages that use similar complex data types. Vcard and address book packages of course, but also for web services such as mailing (UPS, FedEx, Postal Services) or location services (a la Google Maps and so on...) Even though it would just be a glorified array and would increase package dependencies, it would also allow for better API for packages making use of such Structure_* classes (typing comes to mind) and increase package interoperability. Is it too framework-specific? Should it just be an Interface instead of a class? Any thoughts? -PhilippeInteresting... A few times I've thought about a similar idea. PHP already has one such object: DateTime. They'd be more than just glorified arrays that can enforce strict APIs, as I find most objects tend to have semantics that translate into methods. Now if this package was to become realised, it'd be good to allow people to submit their own useful structures as subpackages. I could probably think of a few that might be helpful. -- David Sanders shangxiao