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.

Required fields*

2
  • I am not familiar with autowiring. Can you have X classes being a Subject and Y classes being an Observer, where each Observer receives notifications from a different set of Subjects? Because that is a very common usecase for the Observer pattern (multiple instances of the pattern all over the codebase). Commented May 10, 2020 at 18:19
  • @BartvanIngenSchenau Autowiring is dependency injection provided by the container, similar to @Inject in JavaEE environments. And yes, each observer may be provided to multiple subjects: EmitsSomething could be a concrete Subject, and Y implements ReceivesSomething, ReceivesSomethingElse might be an observer for this subject that also observes notifications from another subject. Commented May 10, 2020 at 19:02