Re: [PEPr] Comment on Web Services::Services_Amazon_SQS
| From: | till | Date: | Mon, 17 Nov 2008 11:55:56 +0000 |
| Subject: | Re: [PEPr] Comment on Web Services::Services_Amazon_SQS | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-51104@lists.php.net to get a copy of this message | ||
Sorry, Michael. That was supposed to go into the Payment proposal. ;-(
On Mon, Nov 17, 2008 at 12:55 PM, Till Klampaeckel <till@php.net> wrote:
>
> Till Klampaeckel (http://pear.php.net/user/till) has commented on the proposal for Web
> Services::Services_Amazon_SQS.
>
> Comment:
>
> Some feedback:
>
> 1) I'd un-tie the hardcoded dependencies in your class. For example,
> SoapClient(). Without making it too complicated, I'd add a public setter
> setSoapClient() and let people inject their own client. And if none is
> provided, only then create your own client.
>
> 2) private vs. protected - use protected to allow people to
> overload/extend your class code.
>
> 3) Use public on methods when appropriate.
>
> 4) Your Exception class needs to extend PEAR_Exception.
>
> 5) I saw you're converting to "cents" somewhere, what if the product you
> sell is in "cents" already? Maybe add some sort of check or configuration
> option to avoid the conversion.
>
> 6) Some of these vendors have a debug/test mode, if there is one, it might
> be a good idea to implement it. I have no idea though - this is just a
> thought. :-)
>
> 7) You'll need a package.xml which lists all dependencies - such as PEAR,
> soap, etc..
>
> Aside from all those, looks pretty clean and very straight forward to use!
>
> Proposal information:
> http://pear.php.net/pepr/pepr-proposal-show.php?id=582
>
> --
> Sent by PEPr, the automatic proposal system at
> http://pear.php.net
>