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?
source
share