Task 4

Senchy
Windoof-User
Windoof-User
Beiträge: 37
Registriert: 6. Okt 2010 19:14

Task 4

Beitrag von Senchy »

Edit:
Seems it might be a good idea to reconsider who is observer and who observable, I think my question is answered

For later readers:
Hi,
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?

Benutzeravatar
sproksch
Computerversteher
Computerversteher
Beiträge: 346
Registriert: 15. Apr 2004 17:56

Re: Task 4

Beitrag von sproksch »

So your question is solved?

Senchy
Windoof-User
Windoof-User
Beiträge: 37
Registriert: 6. Okt 2010 19:14

Re: Task 4

Beitrag von Senchy »

Yes :)

Antworten

Zurück zu „Archiv“