LPW: Slides... DBIC and new recommendations!

James Laver james.laver at gmail.com
Sun Nov 30 13:21:51 GMT 2008


On 2008-11-30 12:43, "Paul Makepeace" <paulm at paulm.com> wrote:
> On Sun, Nov 30, 2008 at 10:39 AM, Leo Lapworth <leo at cuckoo.org> wrote:
> You'll find a ton of opinion on this if you look online.. The general
> consensus AFAICT is to not have plural table names, despite its
> initial seductive appeal (select * from authors, has a ring to it).
> Apart from weirdnesses like person/people, the single row as you say
> expressed as a plural sounds odd, as do plurals in join conditions.
> 
> There's an argument from the ER crowd that entities (classes) are
> singular so why transform your singular entity names to plural when
> making concrete in SQL/database?
> 
> My personal experience has been initially plural and then after much
> SQL/DB work going back to singular as I hated all the little awkward
> moments that seem to crop up.
> 
> (There's the argument that RoR requires plural table names so that
> must be wrong :-))
> 
> Great talk btw :)
> 
> P
> 

There's also the problem with trying to autogenerate table names from entity
names or vice-versa. There are big bugs with all of the inflector modules
I've come across in various languages. The worst of course, happens to be
rails, I seem to recall there being some fuss about it not correctly
pluralising 'sex' at some point.

It's amazing how defensive people can get about their table naming and how
"you're wrong" if you don't do it their way. TIMTOWTDI.

I've stuck to singular because it carries across much easier and because of
the aforementioned problems with inflectors. And it does seem quite natural
when writing in the singular. But then the plural seems more natural when
writing plural parts of the query.... Bah!

--James




More information about the london.pm mailing list