What is the criticism against using display_order fields in your database project?

In my software product of my company, several database tables use the "display_order" field. This is an integer that controls the display order of elements on the page.

At heart, I feel that this is bad practice. (Or at least a less than optimal design choice). However, it’s hard for me to understand why this is bad practice.

So far, the only reasons I could come up with are the following:

  • He mixes the view with the model.

  • Reordering is a potentially expensive database operation that affects many different rows.

  • In many cases, if you knew the order of the elements, the table can be small enough to make the table a waste. For example, in our “statuses” table, statuses should be a simple hard-coded array, and not a separate “search” table.

Does anyone have a good argument for excluding display_order fields in your database project?

+3
source share
4 answers

In some cases, this is the best option for ordering items.

In particular, when the elements do not have a natural ordering, or the natural order is not something that can easily be done using a program (for example, a natural language - phonemes).

"" - , (, -), .

- , "display_order" - .

+4

, , , . , , , .

, , (- , / ) / . , , , ", "

0

, " ", / . , - , drag-n-drop . , , , display_order , .

0

, , , . , "", .

, . , - . , ( " " ) .

, CHECK, ( " " ) , , , " " QA . .

, , . ( ), . dbms .

0

All Articles