4 ms·
I think both the dogmatic programmer and the pragmatic programmer are wrong here and the truth is somewhere in the middle. The code actually touching the databa
by cjfd 5y ago
I think both the dogmatic programmer and the pragmatic programmer are wrong here and the truth is somewhere in the middle. The code actually touching the database and doing queries should be a small percentage of a large application. Mixing database logic and application logic in a large application is just bad. This does not mean that one should make everything abstract, it just means business logic should request data from the database through a layer saying things like Customer cust = GetCustomerById(id) (for instance, there are other possibilities but at least one does not see database code in this explicitly). It will still be a bit painful to switch databases but it will not be impossible. It is okay that it is a bit painful to switch databases if everybody was thinking with good reason that it would not happen. It is not okay that it is impossible to switch databases even if everybody was thinking this would not happen.