develooper Front page | perl.datetime | Postings from January 2003

Re: Parser Interface (Was Re: Picking up the ball)

Thread Previous | Thread Next
From:
David Wheeler
Date:
January 13, 2003 15:38
Subject:
Re: Parser Interface (Was Re: Picking up the ball)
Message ID:
F592E2B8-274F-11D7-A08F-000393D9436A@wheeler.net
On Monday, January 13, 2003, at 11:51  AM, Dave Rolsky wrote:

> Actually, I have some ideas for this.  Something like:
>
>   use DateTime;
>   use DateTime::Parse::MySQL;
>
>   my $dt = DateTime->from_mysql_datetime( $mysql_dt );
>
> So the parsing modules would just add methods to the DateTime 
> namespace.

Ah, the decorator pattern made easy. This once again shows why many 
design patterns are almost meaningless in Perl. ;-)

David

-- 
David Wheeler                                     AIM: dwTheory
david@wheeler.net                                 ICQ: 15726394
http://david.wheeler.net/                      Yahoo!: dew7e
                                                Jabber: Theory@jabber.org


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About