logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: ANNOUNCE: AnyTemplate 0.10_02 developer release and RFC: msg#00288

lang.perl.modules.cgi-appplication

Subject: Re: ANNOUNCE: AnyTemplate 0.10_02 developer release and RFC

Michael Graham wrote:
> Michael - thanks for the feedback!
>
>
>>> * is the ability to override C::A's built-in 'load_tmpl' method too
>>> dangerous a feature?
>>
>>I don't think so. It's extremely well documented that overriding
>>load_tmpl() is par for the course. You module is a plugin/mix-in so it's
>>not only allowed to add behavior, but change existing behavior. I would
>>also think it allows other plugins to use load_tmpl() without having to
>>guess what templating engine is being used.
>
>
> I guess what worries me about load_tmpl() (and for that matter the whole
> AnyTemplate configuration system) is that all the magic and sugar only
> work up to a point.
>
> Developers still need to choose the type of templates they want to use,
> and different apps and plugins need to make different choices.

I guess I was thinking of the simplest of cases where a plugin might
call load_tmpl() and just use the API that's magically the same. If
plugin authors include templates that need to be used, then it'll be up
to them to make sure they're using the right engine... Maybe setup a
separate config instance.

> For instance, I doubt that plugin authors are going to want to ship
> three complete sets of templates with each plugin they make. More
> likely they'll stick to their favourite template engine and leave
> conversion to other template formats as an "exercise for the reader".

I agree. Maybe this isn't so dangerous cause the plugin author would
describe what template engine is supported 'out of box' and just use
load_tmpl(). If the author's load_tmpl does something different than the
plugin wants, it's up to the user to port the templates and put them
where he wants them.

I think that most plugin authors who need to ship templates will try to
limit their template functionality to what AnyTemplate supports to
increase the usability of the plugin.

> So for two different plugins there will be two different 'default'
> template types. For instance, when I say load_tmpl(), I wan't
> HTML::Template. But when you say load_tmpl(), you want Petal, etc.

[snip]

> I've suggested that plugin authors resolve this by using AnyTemplate's
> named configs feature:

Yeah, I think that's a good way. But it doesn't cover the instance where
a plugin might be designed to just work with whatever template engine
the user has. Which is why load_tmpl() is nice, because it doesn't
assume anything.

[snip]

> This does keep everything straight, but it's a royal pain to use. Plus,
> it doesn't work at all for $self->load_tmpl(), since there's no way to
> select a config (or a type) with that method.

[snip]

>
> I guess the options are:
>
> A) document the issues and forget about it
> B) throw an error when one config clobbers another
> C) make the 'default' config more magical:
> * make config store the configuration in the current class
> * make load, fill and process walk the @ISA tree looking for the
> nearest config
>
>
> Option (A) is the current state of affairs.
>
> Option (C) would probably work and it would probably not be as
> dangerously automagical as it looks. It does have the advantage of
> "just working" out of the box.

I think A is fine for now. We probably shouldn't worry too much about
this until someone actually has the problem. It's easier to solve if
there's a real use-case. And if it doesn't come up, then we continue
with a simpler API/code base :)

--
Michael Peters
Developer
Plus Three, LP


---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
krysalis.sandbo...    web.zope.zwiki/...    gnome.apps.gnum...    xfree86.newbie/...    editors.vim/200...    mozilla.enigmai...    boot-loaders.gr...    network.vnc.ult...    redhat.release....    java.geronimo.u...    os.netbsd.devel...    horde.wicked/20...    linux.lsb.discu...    ietf.ips/2005-0...    alsa.devel/2002...    user-groups.lin...    package-managem...    debian.devel.da...    security.cyrus....    video.gstreamer...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation