[General boards] [Winter 2019 courses] [Fall 2018 courses] [Summer 2018 courses] [Older or newer terms]

Observer design pattern


#1

Do I need to create a collection which stores all observers within Observable or is there already a pre-existing collection in Observable that gets used when the addObserver method is called?


#2

Either way you do it, the design pattern is satisfied.

However, if you want to use the built-in Observable and Observer, then no, you do not have to create any collection. The addObserver method takes care of everything.