Re: Subclassing DateTime?

[email protected] (Zefram) Sun, 30 Apr 2017 01:08:58 +0100
Newsgroups perl.datetime
Message-ID <[email protected]>
Thomas (HFM) Wyant wrote:
>It seems to me that in at least some such cases subclassing
>DateTime would be a better alternative.

You've run into the terrible factoring of the DateTime system.  All three
of the modules you named already suffer from it, but subclassing DateTime
would make things worse.  For subclassing to be the right answer,
the objects of your classes would have to be everything that DateTime
objects are, plus something that you're adding.  But one of the things
that DateTime objects are is Gregorian, which your objects are not.

-zefram