Should we use prefixes in our database table naming conventions?

前端 未结 7 2205
攒了一身酷
攒了一身酷 2021-02-05 22:03

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,

7条回答
  •  误落风尘
    2021-02-05 23:00

    Why not name the tables according to the guidelines you have in place for coding? Consider the table name a "class" and the columns a "property" or "field". This assists when using an ORM that can automatically infer table/column naming from class/member naming.

    For instance, Castle ActiveRecord, declared like below assumes the names are the same as the member they are on.

    [ActiveRecord]
    public class Person
    {
        [PrimaryKey]
        public Int32 Id { get; set; }
    
        [Property]
        public String Name { get; set; }
    }
    

提交回复
热议问题