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

From: Peter Speltz (peterspeltz at yahoo.com)
Date: Tue Dec 28 2004 - 21:44:36 GMT


--- Tony Bowden <tony-maypole at kasei.com> wrote:

> On Mon, Dec 27, 2004 at 07:44:23PM -0800, Peter Speltz wrote:
> > > Especially when moniker dosn't seem to be the problem so much as
> > > Class::DBI::Loader.
> > Neither are the problem in Maypole. The problem is Maypole is using
> > $class->moniker as a name of a directory.
>
> That's not the problem. The problem is that moniker is giving the wrong
> answer because Loader is setting up the class name wrongly. If Loader
> didn't mess with underscores, then the moniker would be the table name.
>

Loader's not my problem. It does exactly what it says it does and i like what
it does. Moniker isn't my problem exactly either. It's how it's used in
maypole.

> In the general case here, I believe using moniker() is correct. As
> pointed out, table names will not necessarily be safe for directory or
> file names on all databases.

HOw is moniker correct if you also suggest overriding it? Do you just move your
templates? Doesn't sound fun to me but maybe its no big deal.

We have theory, now maybe some real world data will help here. I think i'll
post a poll after this.

>A class name, from which the moniker is
> derived, will be.

NOt necessarily if one overrides it as I want to do. Question: Can one
override moniker in a way that breaks class dbi?

>
> All of this confusion has come from the fact that Loader has created
> classes with unexpected names.
>

1) I think everyone knows and expects the names Loader gives to classess as
docs give example with '_' in them.
2)Confusion came when people turned question from Maypole to moniker and
loader.

 The REAL issue I want to get closure on is that Maypole doesn't have a
failsafe way to determine where class specific templates are. Maybe a model
class method should determine it. $class->template_dir? Or people can just
override View::Base::paths sub as i did to make it work for them.

 this is becoming a rather entertaining thread , however :).

> > . 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.

NAME
       UNIVERSAL::moniker

SYNOPSIS
         use UNIVERSAL::moniker;

DESCRIPTION
       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.

> 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.
>

examples? what other things?

=====
pjs

                
__________________________________
Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.
http://promotions.yahoo.com/new_mail

_______________________________________________
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