Jim has said what I was about to (with reference to Namespaces and
Subclasses), but let me add my $0.02:  The name (space) has nothing to
do with implementation technique.  It has to do with the problem being
solved, or the API.  One should not assume that every module in a
namespace is a subclass of that namespace. Many infact use aggregation
or containment to solve the problem.  

Date::Calc::Day::Iterator or Date::Calc::DayInterator would be good
choices.  I think it _is_ useful to get the word 'Day' in there, since
someone _could_ come along and choose to implement
Date::Calc::Hour::Iterator... (or HourIterator) .. (you would be setting
the pattern I would think) etc.  If it were just ::Iterator that would
be precluded.

Lincoln
  

On Tue, 2003-12-23 at 10:34, Jim Cromie wrote:
> Marco Marongiu wrote:
> 
> >
> > And, last, there is a proposal to rename it to Date::Calc::Iterator
> >
> > Date::Iterator is not a subclass of Date::Calc: it *uses* it; and 
> > Date::Calc as a namespace for my module is just confusing: my modules 
> > Iterates over Dates, fullstop. The "Calc" part is confusing.
> 
> 
> Derivation/sub-classing is not the only reason to choose a namespace.
> Delegation/has-a relationships (for one) are also a good reason, and it 
> sounds like your module
> fits this case.
> 
> Namespaces are not about implementation (which is what derivation is doing),
> theyre about interfaces.  And for humans, knowing where to find those 
> modules.
> 
>    Mazda-RX-8 has a Wankel motor in it - does that make it
> different enough to not be a Car ?  Of course not.   You drive it just 
> like every other
> car.  Is a minivan a car ? an SUV ?  YES.   Should they be under CAFE ?
> (Corporate Average Fuel Economy - Congressional law)   *Absolutely*
> 
> 
> so wrt finding  Date::Calc::Iterator,  how would one go about it ?   
> search.cpan.org !
> and what are your search criteria ?   *Date*,  *Iterator* 
> 
> I just searched Iterator, and hit several with it as the 3rd level name-
> 
> *File::Find::Iterator* 
> <http://search.cpan.org/author/TEXMEC/File-Find-Iterator-0.3/Iterator.pm>
> *XML::LibXML::Iterator* 
> <http://search.cpan.org/author/PHISH/XML-LibXML-Iterator-1.00/lib/XML/LibXML/Iterator.pm>
> *Test::Harness::Iterator* 
> <http://search.cpan.org/author/RCAPUTO/POE-0.27/lib/Test/Harness/Iterator.pm>
> 
> So sticking Calc in there's not gonna make it any less 'found',
> It adds info wrt your dependency, and it keeps Date::* a little less 
> cluttered.
-- 
Lincoln A. Baxter <[EMAIL PROTECTED]>

Reply via email to