3

I recently started work at a new shop that uses a table naming convention like the following:

  • Users
  • UserRoles
  • UserUserRoles
  • UserProfiles
  • UserProfileLanguages

The convention I've been using is:

  • Users
  • Roles
  • UserRoleMaps
  • Profiles
  • Languages

When my boss asked why I don't prefix my tables, I explained that a database diagram would explain all the relationships much better than any naming convention could. I'm I wrong to assume that?

I'm willing to admit that the first example is more complete (especially if you're only looking at the tables directly), but what's the preferred solution for ORM? For example, in LINQ I would access my user's language like so:

User.Profile.Language

whereas, the first example would be:

User.UserProfile.UserProfileLanguage

Sure, I could easily rename my tables in the LINQ designer to whatever I please, but that quickly becomes a hassle if the data schema keeps changing.

EDIT: Removed APP_ prefix in example because it's not relevant to this question.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Derek Hunziker
  • 12,996
  • 4
  • 57
  • 105
  • Why prefix every table with the app name? What other prefixes are used besides that? – dotjoe Aug 17 '10 at 19:01
  • Sorry, forgot to mention... my shop uses a single database for all applications because "they often need to join data from different apps". That's another question entirely, but I just have to accept it for now. Thanks! – Derek Hunziker Aug 17 '10 at 19:05

1 Answers1

0

I could easily rename my tables in the LINQ designer to whatever I please

Amy B
  • 108,202
  • 21
  • 135
  • 185