I'm worried about drawing a line between what DB should have as a master and what source code should define as a Const list.
Personally, if the user does not edit from the master management screen, I think it should be defined on the source code, but I don't get approval from people around me.
An extreme example is whether the on-screen display names "male" and "female" should be maintained in DB or associative array {0:"male", 1:"female"}
in source code when retaining the gender column of the HR table with code value of 0.
Could you give me your opinion?
Supplemental
The reason why I think I should have it in source code is that if I have it in DB, I often hesitate whether or not to add records to the master without testing during future operations.
In this case, you need to know all the source code to determine if you just need to add a record to the master or if you need to modify the screen layout with the radio button.
Therefore, the criteria for determining exactly are not whether the user edits from the master management screen above, but whether the operation of adding, deleting, or changing records is guaranteed.
On the other hand, the reason why I heard so far that I should have a DB was persuasive is
and so on.
database database-design
Personally, if the user does not edit from the master management screen, I think it should be defined on the source code, but I don't get approval from people around me.
Could you give me your opinion?
I can't decide which method to choose.Both have advantages and disadvantages.
Depending on the requirements, characteristics, and policy of the system, which one is more advantageous will change.
A)Managed by DB Master
Benefits
disadvantages
B)Defined by source code
Benefits
disadvantages
I have a gender column of 0,1 in the HR table, so
I think it's better to have a gender table.
0—Men
1: Woman
Reason:
1. (If the developer knows how to combine the table with the gender table), the mistake of displaying male and female in reverse will be reduced.
2. If you have to add gender such as "other" or "unknown", it is easy to identify the changes.
3. If you later need a list box to select men and women, you can easily change it.
and so on
Gender codes (0 and 1) should not be written in the program as much as possible. It will be flexible (easy to maintain and resistant to changes).
© 2024 OneMinuteCode. All rights reserved.