In which of the following situations would you use the Observer pattern?

  1. When you need to have objects notified of events but you don't know which objects would have such needs, or if you will need to add more objects to receive such notification, at a later date.

  2. You want one object to monitor when the state of another object but you don't want the object being monitored to need to send any messages regarding its state.

  3. When the instances of your class can be use interchangeable and you want to reduce the number of instances created in order to improve performance.

  4. When you need to co-ordinate state changes between other objects by using one object.

  5. You are building an online auction site to sell rare and collectable toys. You want customers to be notified of bids on items they are bidding for in as close to real time as possible. You would use the Observer pattern to notify the customer objects of c


Correct Option: A,E

Find more quizzes: