On Sun, 6 Jul 2003, Joshua Hoblitt wrote:

> Available immediately from:
>
> http://kolea.ifa.hawaii.edu/~jhoblitt/pm/DateTime-Cache-0.01.tar.gz
>
> I'm not sure if this should be DateTime::Util::Cache instead.  I prefer
> the Util::* namespace but I wanted to keep the name as short as
> possible.  As soon as a namespace is agreed upon I'll move this to SF
> cvs.
>
> This module is a subclass of DT (yes Dave, I subclassed DT again) and
> wraps the constructors with Memoize.

I strongly suspect that DT will eventually spawn multiple "subclasses with
extras" like this, as people will want little bits of functionality added.

What's worse, people will want to mix and match these, and subclasses make
doing that _really_ awkward.  We have this same problem with Mason, where
people want to (or _will_ want to) combine multiple direct subclasses of
a class.

AFAICT, the solution for this is to implement some sort of decorator
registration scheme, so that we can have:

 DT::Cache => wraps DT::FooBar => wrap DT.pm

and _neither_ DT::Cache and DT::FooBar are subclasses of DT.pm.  They're
simply decorators, so that they can be stuck into the wrapping chain
anywhere.

If someone knows of something on CPAN for this, please tell me.  There is
Class::Decorator, and maybe that plus a little syntactic sugar might be in
order, so we can do:

  DateTime->register_decorators( qw( DT::Cache DT::FooBar DT::Baz ) );

and then various DT methods may be wrapped.

The big thing here, of course, is coming up with a nice pretty API that is
easy to document.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to