1
1
12rbah2021-02-20 10:35:35
Software design
12rbah, 2021-02-20 10:35:35

Storing all UI elements in one structure is it okay to do this?

In general, in the program I have a large structure that contains about 20 elements, most of them are UI elements (which are updated in a separate thread) that can change during the program's operation. The meaning of such a structure on my part is that when it was necessary to add a new element to the program, I did not need to change the arguments in each function, because they passed this structure (just add an element to the structure, and then you can use it in the desired function). Therefore, I wanted to clarify whether it is normal to do this or not?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
VitalyChaikin, 2021-02-20
@VitalyChaikin

The key criterion in my opinion is: "How easy is it to debug / modify with your approach" You need to strive to increase the comfort of debugging, and based on this, design data structures.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question