On Fri, 1 Apr 2005 [EMAIL PROTECTED] wrote:

> Assuming you have a base class called Money and a subclass called Coin
> (where the Coin package declares @ISA = qw (Money)), what is the
> appropriate naming convention?
> 
> Classes - Money and Money::Coin
> Files - Money.pm and Money/Coin.pm
> 
> or
> 
> Classes - Money and Coin
> Files - Money.pm and Coin.pm
 
It's up to you of course, but if the objects naturally would be 
organized hierarchically -- as in this case -- then setting up the 
modules that way makes sense. 

But it may make sense to sort through what you're dealing with before 
deciding on this particular example. Consider some possible wrinkles: 

 * What about cash vs. credit ? If they matter, then maybe it should be:
   Money::Cash::Coin, Money::Cash::Paper, Money::Credit::Visa, etc.

 * What about foreign currency ? This may require multiple inheritance, 
   but dealing with this one could be complicated.

...and maybe other factors I'm not thinking of...


-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to