Re: [Maypole] Why is moniker used instead of of table name when looking for table specific templates?

From: Dave Howorth (Dave.Howorth at acm.org)
Date: Tue Dec 28 2004 - 14:03:14 GMT


Tony Bowden wrote:
>>. Isn't moniker is meant for human consumption not computer consumption.
>
> I'm not sure where you got that idea, but I wouldn't agree with that.
> One of the primary uses of moniker, and certainly the one that led to
> its creation, was to allow the computer to make sensible guesses at what
> to call other things based on a class name.

I'm going to commit the cardinal sin of answering for other people here
but certainly when I read UNIVERSAL::moniker's documentation ...

   "Class names in Perl often don't sound great when spoken, or look
good when written in prose. For this reason, we tend to say things like
"customer" or "basket" when we are referring to My::Site::User::Customer
or My::Site::Shop::Basket. We thought it would be nice if our classes
knew what we would prefer to call them."

... I got the impression that what was returned by moniker was intended
for display to humans rather than for use in code. That impression was
reinforced by Maypole placing the moniker in the template variables
explicitly so that it can be displayed on a page. And that was the
context in which I first encountered moniker. Others may have had a
similar experience.

It was only when I discovered that Maypole produces faulty page content
for table names with multiple words that I dug into the code and
discovered what moniker really does and also what Class::DBI really uses
it for.

In my perfect world ... moniker's documentation would read a bit
differently - more like Peter's suggestion - and Maypole would NOT
include moniker in the classmetadata but would instead generate a
consistent set of displayable strings for table and column names in a
manner that is intended to be overridable.

To answer Peter's question from another mail in this thread, yes I have
continued developing my loader. It can generate display strings as I
describe above that work for me. It's not finished and I'm not convinced
that the method it uses is the best approach to the problem even for me
let alone anyone else. But it has nailed that issue for me sufficiently
that I can move on to other issues for now and get on with developing my
application. I'll post another snapshot of it next week when I get back
to work.

Cheers, Dave

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.298 / Virus Database: 265.6.5 - Release Date: 26/12/04

_______________________________________________ maypole mailing list maypole at lists.netthink.co.uk http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT