in reply to Re: CPAN Module Proposal: Business::Ship
in thread CPAN Module Proposal: Business::Ship
I guess it depends somewhat on your long term plans for this. If it were just this, I'd be inclined to use something a bit more descriptive. Like, Business::Shipping::Calculator or Business::Shipping::Cost or something.
Well, honestly I didn't get far past the fact that even the POD didn't display cleanly in an 80 char wide terminal... In fact, the POD seems to be pretty well broken, at least for the Ship.pm file. So, I took a look, but not a very deep one.Heh heh heh... I went to all the trouble to write the POD, then I forgot to even test it. :-)
I see you are trying to abstract out common things about packages in Business::Ship::Package and trying to include information about packages required by a specific shipper Business::Ship::<carrier>::Package. I wonder if it might not make more sense to just have a single package class which can hold all the information that might be required by a specific carrier. I certainly don't have a good overall picture of your design yet, but separating that stuff seems to be more complicated than necessary. Afterall, a package is a package is a package no matter who ships it.Perhaps, I'll have mull over that for a little while. "Package" doesn't represent a physical package, really, but more of a "what does the carrier think of a package as?"
Ideally, this would be written so that if you wanted to add Airborne Express next week, you could just write a Business::Ship::Airborne::Rates module and drop it in. I'm not familiar enough with the problem space (it's probably pretty messy) to decide how easy or hard that would be. Just the same, that's what I'd strive for.Yes, that's exactly what I'm striving for -- so I really appreciate your advice :-). I guess having the Package object is an additional piece of complexity.
Great idea! Part of that feature (like "what services are available for xyz vendor?") are specifically supported by some vendors' XML API.use Business::Shipping; # Query the module for installed shipper specific modules. my @shippers = Business::Shipping::available_shippers(); my %shipping_option; for my $shipper (@shippers) { # Services would be Ground, 2nd day air, things like that. my @services = $shipper->services(); for my $service (@services) { # The $package would have been previously generated. $shipping_option{$shipper->name}->{$service} = $shipper->rate($service, $package); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: CPAN Module Proposal: Business::Ship
by sauoq (Abbot) on Jun 01, 2003 at 21:46 UTC | |
by danb (Friar) on Jun 03, 2003 at 09:19 UTC |