Categories
All Categories
DMV
ServSafe
OSHA
NCLEX
HESI
TEAS
ATI Nursing
CNA & Nurse Aide
NREMT & EMS
ACLS
BLS
CPR
Quizzes
Study Guides
Flashcards
Packages
0
Log In
Register
Categories
All Categories
DMV
ServSafe
OSHA
NCLEX
HESI
TEAS
Quizzes
Study Guides
Flashcards
Packages
Contact
Cart
0
Log In
Register
TJR Bootcamp Practice Test
Access More Questions
Report question problem
×
I think the answer is wrong
There are multiple correct answers
There is a typing error
Image or comprehension text is not display properly
Something else(please specify below)
Any more information
Which design pattern lets observers subscribe to changes in another object?
Singleton pattern
Factory pattern
Observer pattern
Adapter pattern
Reveal Answer
Correct Answer:
Observer pattern
Explanation:
The key idea here is that one object can notify others about its changes through a subscription mechanism. In this pattern, a subject keeps a list of observers that have expressed interest, and whenever the subject’s state changes, it sends out a notification to all registered observers. Observers can subscribe or unsubscribe at runtime, and their responses are triggered by those notifications. This decouples the subject from the observers, so the subject doesn’t need to know who’s watching or what they’ll do with the update. That dynamic, broadcast-style relationship is what makes this pattern the right fit for letting observers subscribe to changes in another object. A practical example is a model in a UI: when the model changes, it notifies all registered views, and each view updates accordingly. The other patterns aren’t about notifying dependents: a Singleton ensures a single instance, a Factory focuses on creating objects, and an Adapter translates interfaces between SAMPLEcomponents.
Access more questions from this quiz
Continue to TJR Bootcamp Practice Test for more practice questions and the full quiz experience.
Access More Questions