Hello everybody.
I am working on a bigger project where I have several classes.
The application will read data from a textfile, buffer it locally, and send it to an mqtt broker.
It has also a GUI to configure settings and check if it is working ok.
When the "read csv" class fails to read the file, the gui must be updated to inform the user that something is wrong.
What is the best way to pass this to the main or gui class?
To make the program as modular as possible, I have made a drawing where I have three approches.
Approach 1: This is the best to prevent randomly call multiple classes, it is more in a parent/child way.
The disadvantage is that i will have a lot of call's in my core class, which can become "messy".
Approach 2: Use a dataclass, more mixing of classes. Quite "simple" to do.
Not a real event driven way ...
Approach 3: Simple event driven, still the main class wil get big. When to program grows, this can get also a mess.
What is the best way to handle these events between classes?
How do you add structure to your programs?
Any advice?
Thanks in advance,
Coldrestart.
I am working on a bigger project where I have several classes.
The application will read data from a textfile, buffer it locally, and send it to an mqtt broker.
It has also a GUI to configure settings and check if it is working ok.
When the "read csv" class fails to read the file, the gui must be updated to inform the user that something is wrong.
What is the best way to pass this to the main or gui class?
To make the program as modular as possible, I have made a drawing where I have three approches.
Approach 1: This is the best to prevent randomly call multiple classes, it is more in a parent/child way.
The disadvantage is that i will have a lot of call's in my core class, which can become "messy".
Approach 2: Use a dataclass, more mixing of classes. Quite "simple" to do.
Not a real event driven way ...
Approach 3: Simple event driven, still the main class wil get big. When to program grows, this can get also a mess.
What is the best way to handle these events between classes?
How do you add structure to your programs?
Any advice?
Thanks in advance,
Coldrestart.