Re: PEAR2 package naming standards (namespace usage)
| From: | Travis Swicegood | Date: | Tue, 26 Aug 2008 19:01:52 +0000 |
| Subject: | Re: PEAR2 package naming standards (namespace usage) | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-50634@lists.php.net to get a copy of this message | ||
On Aug 25, 2008, at 8:20 PM, Michael Gauthier wrote:
The proposed spec looks good and whatever ends up being finalized, I'll gladly port and maintain all packages for which I'm responsible.Glad to hear!
One concern I have with the proposal is of making namespaces and packages synonymous. When we do this, we lose one of the intended uses of namespaces which is to provide a categorizational hierarchy for classes. For example, I maintain the PEAR1 Crypt_GPG package. In the proposed standard, the namespace would become pear2::crypt_gpg. I think it should really be pear2::encryption::gpg. I'm sure one of the reasons for the direct package-name-to-namespace mapping is ease of development from svn, and if The PEAR Group feels it is a sacrifice that needs to be made, so be it.This is definitely something we, as the PEAR Community, will need to think about. A great package might be a pear2::encryption package that has support for encryption drivers. <personal opinion - i.e., not that of pear-group@> This does bring up an excellent point. In many cases, it may be better to change the packages around a bit for better organization instead of doing a straight port. PEAR1 hasn't always fostered the best design so much as the first. Starting with a clean slate and no BC concerns definitely frees everyone up to re-implement everything the way they always wanted to :-) </personal opinion>
My last concern is more a matter of preference. Since PEAR1 does not support namespaces, do we have to use 'pear2' as the root namespace? I'd much rather 'pear'.I believe the decision was made by the first PEAR Group to adopt "pear2" as the vendor level namespace to differentiate between the two libraries. I know at one point, switching names was even considered, but they landed on "pear2" to say we're different, but still continue the name recognition of "pear" as a whole. Some from the first PEAR Group can correct me if I'm wrong... -T