Seite 1 von 1

Task 4

Verfasst: 2. Jul 2012 14:12
von Senchy
Seems it might be a good idea to reconsider who is observer and who observable, I think my question is answered

For later readers:
i am a bit confused about Task 4.
We are not allowed to change the source, so who should implement the Observer-Interface?
Besides an Observer seems to have only one Subject, and one subject seems to have multiple Observers.

My actual approach was to use the declare parents hint and implement Subject in the Thermometers, but now i have to hook into the constructor and add them some observers to get logging without changing the code. May we reuse some existing classes and extend them to observers using aspects declare function again?

Otherwise it might be more easy to pointcut in the change-methods and do the observing directly with the aspect (like in task2) :)

Any hints?

Re: Task 4

Verfasst: 2. Jul 2012 14:31
von sproksch
So your question is solved?

Re: Task 4

Verfasst: 2. Jul 2012 14:40
von Senchy
Yes :)