Skip to content

PopoverManager: use GLib.Once#683

Closed
danirabbit wants to merge 1 commit intomainfrom
danirabbit/popovermanager-singleton
Closed

PopoverManager: use GLib.Once#683
danirabbit wants to merge 1 commit intomainfrom
danirabbit/popovermanager-singleton

Conversation

@danirabbit
Copy link
Member

Make popovermanager a singleton instead of passing around references to it

@danirabbit danirabbit requested a review from a team March 24, 2026 19:19
Copy link
Member

@leolost2605 leolost2605 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we shouldn't convert to a Singleton. There's a bunch of literature that Singletons are considered an anti pattern except for a few very specific cases (e.g. a log).
https://en.wikipedia.org/wiki/Singleton_pattern#Criticism
In my experience in a few personal projects, not using singletons leads to a better structure because you have to think about who uses what. Also IMO the code it saves here isn't really code that we have to try to reduce, since it's not really any logic. But that's just my opinion based on what I found and heard from others 🤷

@danirabbit
Copy link
Member Author

That's a fair criticism and maybe this can be cleaned up in a better way. I'll approach it with a different mindset. Thank you!

@danirabbit danirabbit closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants