SOFTWARE DESIGN
DESIGN PATTERNS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Allows (a group of) objects to be notified when some state changes.
|
|
Provides a way to traverse a collection of objects without exposing the collection’s implementation.
|
|
Changes the interface of one or more classes.
|
|
Simplifies the interface of a group of classes.
|
|
Encapsulates interchangeable behaviours and uses delegation to decide which one to use.
|
Detailed explanation-1: -The observer pattern is a behavioral design pattern that defines a one-to-many relationship between objects. It allows an object, called the subject, to notify other objects, called observers, about any changes in its state.
Detailed explanation-2: -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. Each bidder possesses a numbered paddle that is used to indicate a bid.
Detailed explanation-3: -Q 20-Which of the following describes the Observer pattern correctly? A-This pattern is used to get a way to access the elements of a collection object in sequential manner without any need to know its underlying representation.