|Think about Loose Coupling|
Re: Re: CPAN Module Proposal: Business::Shipby danb (Friar)
|on Jun 01, 2003 at 16:13 UTC||Need Help??|
Thanks for the input, diotalevi. The reason I picked Business::Ship was because calculating shipping cost isn't the only feature that I wanted to support. In the future, I plan to add:
* Address Verification
* Shipping status (tracking)
* Electronic Merchandise Return
* Shipping label generation
* Customs forms
* Shipping time (how long till it gets there)
* Delivery/Signature confirmation
I see that you've hardcoded various strings in your code like the following country name translator. You should either delegate this job to something else or move the data outside your program.
Good advice, I'll do that.
I also notice you use the indirect object syntax - that's likely a mistake on your part and it should be rectified.
I like the object factory design a lot, so I probably used it even though it wasn't necessary. But the idea was that it would make it easier on the API user to use UPS or USPS (eventually others) without changing much code. Namely, they can get the sub-object without doing an eval. For an example, see doc/xps-query.tag.