SOFTWARE DESIGN
DESIGN PATTERNS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
The Observer Pattern defines a many-to-many relationship.
|
|
The Observer Pattern defines a one-to-many relationship.
|
|
The Observer Pattern defines a one-to-one relationship.
|
|
The Observer Pattern defines a many-to-one relationship.
|
Detailed explanation-1: -The observer pattern defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated automatically. The object which is being watched is called the subject. The objects which are watching the state changes are called observers or listeners.
Detailed explanation-2: -Observer pattern (also known as Publish-Subscribe Pattern) is used when there is one-to-many relationship between objects such as if one object is modified, its dependent objects are to be notified automatically.
Detailed explanation-3: -The Observer defines a one-to-many relationship so that when one object changes state, the others are notified and updated automatically. Some auctions demonstrate this pattern.