Re: Fwd: proposing a new package, questions about naming ..etc.
| From: | Patrick E. | Date: | Sun, 26 May 2013 12:42:35 +0000 |
| Subject: | Re: Fwd: proposing a new package, questions about naming ..etc. | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-55237@lists.php.net to get a copy of this message | ||
Hi,
just a suggestion:
You _could_ let the User inject an Object for the Request Getter/Setter,
then you don't need to create an Instance in the Constructor
and one is not bound to one implementation (a class that uses the curl
extension).
One could inject Services_Solr_Request_Sockets or an Wrapper of
HTTP_Request2 instead of Services_Solr_Request_Curl,
therefore they both need to implement an Interface like
Services_Solr_Request, only.
You could also provide a method like init() or connect() where you
create the default RequestObject it if not given or set.
> should it be called
<Category>_<Name>, therefore Net_Solr or Services_Solr.
The Name "Http" for a Class would not match that naming convention.
Since the Class uses Curl, i would call it
<Category>_Solr_Request_Curl, ie. Services_Solr_Request_Curl.
you can also find a HowTo in the PEAR Docs :
http://pear.php.net/manual/de/developers.contributing.howto.php
--
Patrick