SOFTWARE ENGINEERING

SOFTWARE DESIGN

DESIGN PATTERNS

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which text below describes the Observer Pattern best?
A
Allows (a group of) objects to be notified when some state changes.
B
Provides a way to traverse a collection of objects without exposing the collection’s implementation.
C
Changes the interface of one or more classes.
D
Simplifies the interface of a group of classes.
E
Encapsulates interchangeable behaviours and uses delegation to decide which one to use.
Explanation: 

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.

There is 1 question to complete.