Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • 1
    It isn't entirely clear to me how your question relates to the open/closed principle but you can remove your coupling of WelcomePage to userData by injecting the AboutDialog (or a factory/strategy to create the AboutDialog) into WelcomePage instead of injecting the userData. Commented Nov 27, 2019 at 11:01
  • 8
    "Isn't disallowing global state results in more coupling here?" No, there is exactly the same amount of coupling. But with DI you can see it Commented Nov 27, 2019 at 13:16
  • 2
    Instead of proposing a cage match between competing software principles, ask yourself, "What makes the most sense to do here? Commented Nov 27, 2019 at 15:10