Design Question - Put hundreds of Yes / No radio buttons in columns, rows, or others?

We are migrating an old application that uses a hierarchical database into a relational web application and trying to find the best way to switch configuration switches (Y / N values).

In our old system, there were 256 different switches (per client), each of which was stored as a bit in one of the 8 32-bit data fields. Each client usually has ~ 100 switches. To read or set the switch, we will use bitwise arithmetic using the value #define. For example:

if (a_switchbank4 & E_SHOW_SALARY_ON_CHECKS) //If true, print salary on check

We discussed which approach to store keys in our new relational (MS-SQL) database:

  • Put each switch in your box
    • Pros: quick and easy read / write / access - 1 line per client
    • Cons: it seems kludgey, you need to change the circuit every time we add a switch
  • Create a row for each switch per client
    • Pros: unlimited switches, no circuit changes required with new switches.
    • Cons: a little harder to pull out data, lose intellisense without extra work.
  • Maintain Bit Fields
    • Pros: the same code can be used, smaller transfers of XML data between machines.
    • Cons: it makes no sense for our developers, it's hard to debug, it's too easy to use the wrong "switch bank" field for comparison.

I'm leaning towards number 1 ... any thoughts?

+3
source share
6 answers

It depends on several factors, such as:

( ), , . , ( ), / , , .

№2 , , . , , , .

, : . , 7, 45 130, 86 14, , .

+4

, . , , , () , .

+2

# 2, .

# 1 # 2. , , , . . , , - , , .

+1

, , , . , , , . , , , . , , , , , . ( ) . , , , , , . , , , . , , , , .

+1

1, 4 .

4- . .

0

2. / , . 256 + .

# 2 , -- :

Client   S1 S2 S3 S4 S5 ...
A            X     X
B         X  X  X

.

-1

Source: https://habr.com/ru/post/1704630/


All Articles