Doubts about table of states and cities

0

Friends, good morning. I am having a question about how best to populate a combobox with state information and another one with city information.

My question is, what would be the best performance question or good practice question? have a table in the database, and whenever I run the form, does it query the database? or define this table directly in the code, because the states will not change and the cities will not either.

coupon

    
asked by anonymous 19.07.2016 / 13:32

1 answer

2

Of course, in terms of performance, it is best if the information is defined directly in the code, because it avoids communication with the database or any other structure that makes it available.

Speaking of good practices, as a rule, defining hard coded structures is not a good practice, since whenever you need to change something, you must also compile the application.

Finally, everything depends on your requirements and what the application itself requires.

    
19.07.2016 / 13:40