On Wed, Oct 31, 2001 at 11:47:17AM -0600, Chuck Adams wrote:
> While Template::Provider can be easily subclassed, its fetch method doesn't
> know the context, and thus can't access any data from the context like
> the document stack 

True.  I need to revisit Template::Provider because it's not that easy to 
subclass for a number of reasons.  Alas my head is full this week, but
I have a small opening in my TODO stack... :-)

> This works, but is a bit brittle, since it sort of violates
> the API specs.  Of course since my custom Provider has to make callbacks
> into the Context that don't exist in Template::Context anyway, I don't
> suppose I can always avoid breaking the interface contract in subclasses.

But you're also subclassing the Template::Context to redefine the 
template() method to pass $self to the provider, right?  Although this
may violate the internal API, at least it does it so a consistent and
reasonably future-proof way.

>  Kind of makes me wish perl supported named args in a more efficient
> manner...

Me too!

  http://dev.perl.org/rfc/57.pod   (amongst others)


A



Reply via email to