Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple Desktop GUI Architecture

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.

like image 544
Kevin Hicks Avatar asked Nov 27 '25 09:11

Kevin Hicks


1 Answers

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.

like image 188
Derick Schoonbee Avatar answered Nov 29 '25 01:11

Derick Schoonbee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!