Entity Names and Table Names

We are going to develop a new system on top of an obsolete database (using .NET C #). There are about 500 tables. We have chosen the ORM tool for our data access level. The problem is the namig convention for entities.

Tables in the database have names like TB_CUST- a table with customer data or TP_COMP_CARS- company cars. The first letter of the prefix defines the module, and the second letter defines its relationship to other tables.

I would like to call the objects more meaningful. Like TB_CUSTjust Customer or CustomerEntity. Of course there will be a comment pointing to his table name.

But the database administrator and programmer in one person do not want such names. He wants the names of the objects to exactly match the names of the tables. He says that he will need to remember two names, and it will be difficult and random. I must say that he is not very familiar with the principles of OOP.

But in the case of an object name such as TP_COMP_CARS, there must be method names such as Get TP_COMP_CARSor SaveTP_COMP_CARS.. I think this is unreadable and ugly.

So please tell me your opinion. Who is right and why.

Thank you in advance

+5
source share
7 answers

ORM , . , , ORM .

, , , ....

+11

? IMHO.

, , , , ORM, .

0

TB_CUST, , , Customer . , . GetTB_CUST() , GetTB_CUSTFromThatSQLDatabaseWeHave() .

0

, , . Java, , / , . , , Business Logic . , .

, , ...

 Customer == TB_CUST

! , ORM. DBA/Programmer , , , , .

0

, , , . . , , , . , ORM . ORM , DAL .

0

500 - , . , , .

500 ORM, . , , , . , 2 .

500 - 3 . ORM , . , , .

, ORM. :

  • - , . - . .
  • .. - . , .
  • , , - , "" . , , , .
0

" , .

, TP_COMP_CARS, , Get TP_COMP_CARS SaveTP_COMP_CARS..I , .

, , . ".

, -, " ".

, "" "getter and setter": , " ".

- "" (, , ) .

, getTP_COMP_CARS (, , "" ). , " " , -, , . ( , , TP_COMP_CARS, , " ": " ", , , - .)

There is nothing right and wrong with this. Such names were a common convention in the days preceding the ones in which we now live. At the very least, these names usually had the advantage of case insensitivity, in contrast to the braindead (case sensitive) naming rules that are imposed on us by so-called "more modern" systems.

Twenty years later, people will call the naming conventions we use these days: "braindead."

-1
source

All Articles