我们应该在我们的数据库表命名约定中使用前缀吗? [英] Should we use prefixes in our database table naming conventions?

查看:140
本文介绍了我们应该在我们的数据库表命名约定中使用前缀吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在为我们开发团队在工作中决定表,列,过程等的命名约定。单数复数表命名已经决定,我们使用单数。我们正在讨论是否为每个表名使用前缀。我想阅读关于使用前缀的建议,以及为什么。

We are deciding the naming convention for tables, columns, procedures, etc. at our development team at work. The singular-plural table naming has already been decided, we are using singular. We are discussing whether to use a prefix for each table name or not. I would like to read suggestions about using a prefix or not, and why.

它是否提供任何安全性(至少是一个可能的入侵者的另一个障碍)?我认为通常更容易用一个前缀来命名它们,以防我们在代码中使用表的名称,所以不要将它们与变量,属性等混淆。但是我想阅读更多有经验的开发人员的意见。 / p>

Does it provide any security at all (at least one more obstacle for a possible intruder)? I think it's generally more comfortable to name them with a prefix, in case we are using a table's name in the code, so to not confuse them with variables, attributes, etc. But I would like to read opinions from more experienced developers.

推荐答案

我更喜欢用应用程序或解决方案的短名称为表和其他数据库对象加前缀。

I prefer prefixing tables and other database objects with a short name of the application or solution.

这有助于在两种可能出现的情况下:

This helps in two potential situations which spring to mind:


  1. 如果您选择使用任何需要应用程序数据库中的表的第三方框架组件(例如asp net成员资格提供程序),则会产生冲突。

  1. You are less likely to get naming conflicts if you opt to use any third-party framework components which require tables in your application database (e.g. asp net membership provider).

对于客户,它们可能限于单个数据库(特别是如果他们为外部托管付费),要求他们将多个应用程序的数据库对象存储在单个数据库中。

If you are developing solutions for customers, they may be limited to a single database (especially if they are paying for external hosting), requiring them to store the database objects for multiple applications in a single database.

这篇关于我们应该在我们的数据库表命名约定中使用前缀吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆