[Zope-Coders] Replace Zope2 DateTime._parse() with Zope3's DateTimeParser

Shane Hathaway shane@zope.com
Fri, 22 Nov 2002 09:56:08 -0500


Steve Alexander wrote:
> In Zope 3, my suggestion could be implemented with an adapter that 
> adapts a generic DateTime parse to a USDateTime parse object.

Just a coding style question: wouldn't it make more sense for a 
USDateTimeParser to be a subclass of DateTimeParser?  I know adapters 
are "hip" these days :-) but it seems much more natural to write a 
subclass in this situation.

Now, if you had hypothetical TextualDateTime objects lying around, you 
might want to register an adapter for ITextualDateTime that can convert 
to IDateTimeParser.  The registered adapter would be either the US or 
generic version.

Shane