develooper Front page | perl.datetime | Postings from April 2017

Re: Subclassing DateTime?

Thread Previous | Thread Next
April 30, 2017 00:09
Re: Subclassing DateTime?
Message ID:
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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About