📜 ⬆️ ⬇️

Programmer's Dilemma

I have a windows-application with several forms. Some forms are called from others, according to this principle in specific situations, forms are parental and child. Parental forms transfer in child any parameters. An application is an interface with a database, therefore, as a rule, in the parameters, some IDs are passed, by which samples are taken in child forms. For example, display contracts entered into with the payer. However, in the heading of the child form there is a need to more informatively describe who we are dealing with: you can’t write to the user "Agreements concluded with the payer 1124571". It would be better to make it clear that 1124571 is the Krasnaya Dawn shop.
And then the question arises - where to pull out, in this case, the name of the payer? Option two. The first is to re-pull from the database. The second is to pass it as an additional parameter from the parent form. The first option is a more correct ideological one, but it will lead to an extra query to the database and, as a result, will slow down the program performance. The second option will not affect the speed, but it looks illogical from the point of view of the PLO.
How to be? ..

')

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


All Articles