I have class where I have settings stored.
Theres also another class session that reads data from previous class (it reads settings).
Class settings contains a list of available servers, which is needed by session class. Im unsure how should I store information in session class that needs to know which the previous server in a list was (so it can move to the next in a list when its needed).
Should I store current_server variable with an iterator? Im unsure if they are suitable for this kind of purposes. Should it be better to store the server with an integer (the number in the list)?
Next thing is that server list in settings class can be updated. I guess the best approach would be to inform session class that server list was updated, so that current_server is set to the first in the list.
Does anyone have a better idea how to implement this?
Thanks for help