Re: Proposed module for the DateTime namespace

[email protected] (Zefram)
Newsgroups perl.datetime
Message-ID <[email protected]>
Frazer Irving wrote:
>Second, I am planning make this module a subclass of DateTime::Span. Are
>there any problems with this approach I may be unaware of?

This seems silly.  Your comparison functions will be most useful if
they can be applied to DateTime::Span objects.  As far as I can see your
subclass isn't changing any behaviour of DateTime::Span, but is merely
a vehicle to provide access to your new functions that are a layer on
top of the existing behaviour.  The overall effect of such subclassing
is to prevent access to the new stuff in situations where it's applicable.

I suggest that your comparison predicates should be either standalone
functions (for which the module name "DateTime::Span::Compare" is an
excellent choice) or additional methods in the DateTime::Span class.
I think the former is the most sensible interface.

-zefram
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.