You're developing a system where multiple modules need to be notified whenever a particular event occurs. Which design pattern would you implement to achieve this?

  • Command
  • Mediator
  • Observer
  • Prototype
The Observer pattern is appropriate for scenarios where multiple modules need to be notified of changes in another object. It establishes a one-to-many dependency between objects, ensuring that when one object changes state, all its dependents are notified and updated automatically.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *