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

Matt S Trout dbix-class at trout.me.uk
Mon May 5 12:07:56 BST 2008


On Sun, May 04, 2008 at 08:55:55AM -0700, J. Shirley wrote:
> 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.

Which is why I think the default should be -, not _.

Most developers don't know it's better SEO. Let's try and give them a default
that DTRT.

> >
> >  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 :)

I don't want to step on the toes of DB triggers in databases where they
work elegantly and are the correct solution to the problem.

Sometimes they aren't. And sometimes some cunt makes you use MySQL.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the DBIx-Class mailing list