[Dbix-class] RFC: DBIx::Class::Tokenize

J. Shirley jshirley at gmail.com
Sun May 4 16:55:55 BST 2008


On Sat, May 3, 2008 at 3:34 PM, Matt S Trout <dbix-class at trout.me.uk> wrote:
>
>  Search engines generally treat foo_bar as a single word and foo-bar as two,
>  so I agree re '-'.

However shallow this is, the reason for it is precisely this.  In my
app I override the tokenization method to ascend a parent tree, and
join the parent tokens with '-' rather than '_'.

So, in the case of a tree like "Cars > Performance > Engine > ECU" I
would have cars-performance-engine-ecu as the token, which is better
SEO.

>
>  Also, are we not really looking at a "create <something> automatically
>  before insert" component and then the tokenize behaviour being a standalone
>  module? I can see it being useful for other things as well.
>

I didn't want to step on the toes of DB triggers, since the create
something before insert is in that territory.  Create [modified
relation to something else] before insert seems programmatic enough to
be a component... These days I tend not to ever use triggers because I
like the flexibility of not using them, but I don't want to promote my
own bad lazy habits on others :)

-J



More information about the DBIx-Class mailing list