Observer
We’ve been going over design patterns for the past two days. A few of them we have already implemented, but we’ve been going over and Tim has been explaining the ones we aren’t already familiar with. For our homework tonight, we’re to research the Observer pattern and talk about the language features supported by Java that enable the pattern.
Observer Pattern
What I’ve found about ‘ole Observer is that it is a pattern in which there is an observable object that has observers that watch it. When the observable object changes state, it notifies its observers of the change. One example of this that I’ve found online was messages/notifications on social media. A real world, non-programming example would be news agencies letting channels know of news updates (I think the article I found this example in was written before 24 hour news channels were a thing..).
As for the features supported by Java that enable the Observer pattern, I believe what Tim is asking for is that there is an Observer interface built in to java.util. This interface actually defines the update();
method automatically so we don’t have to make it from scratch. At least that’s what I hope he’s asking for.