Previously while designing desktop applications, I have always found it hard to architecture a clean way for different windows to communicate with each other.
For example: A settings/option dialog window that modifies the behavior of the main window.
Would making my "Main" (e.g. where there should only ever be one instance of a window visible at a time) Singletons be a good idea? Since there are only supposed to be one at a time anyways?
This would make it easier, and cleaner for separate windows to communicate.
If the above is true, then I could add Facade-like methods for a clean interface to other windows.
For example: MainWindow.setFont(Font f);
Thanks for any input.
A good read on the topic is GUI Architectures from Martin Fowler which covers various design patterns. For example the Observer Synchronization pattern might work for you in the context of the referenced article.
If you can, I suggest that you stick to some well known framework since writing your own can be a daunting task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With