In my plugin architecture, plugins should have access to all the main components of the application, for example. in the main window, widget settings, settings, tray icon and several global immutable variables.
Since the application is a global single, it directly subclasses it and makes all of these components members of the application. That way, I can easily access them from all over the world. 2. I can phase their API for plugins 3. Naturally, the components are members of the "application".
However, reading SO lessons on singles and globals, he feels like a bad design, but otherwise I will have to implement the main facade and pass it on, which is also a bad design, and finally less straightforward.
source
share