deucalion0 0 Junior Poster in Training

Hi there, I have been studying he Observer pattern among other design patterns, and I am having difficulty understanding how it works. I have read the design patterns book by Head First where applicable and researched it like crazy on the internet. I was wondering if anyone can point out the different varaitions of the Observer pattern and maybe show a simple example of how it actually works? I understand the pattern at a UML level, but I cannot write code that gets it to work.

I have an integer that can can change value and I have an Abstract class called character, which subclasses to four character types, the instances of these character types must be informed when the integer has changed state. Is the observer interface implemented by the abstract class or the subclasses?

Here is my UML diagram so far, maybe this will help explain what I am trying to do. UML

I would appreciate any advice at all on the observer pattern.

Many thanks!