I'm trying to write a generic observer pattern interface.
I'm trying to write a generic observer pattern interface.
I've found an old exemple on Delphi Praxis website. Looks interresting, Uwe Raabe wrote it : http://www.delphipraxis.net/1141754-post6.html
I took this code and tried to compile it under Delphi Berlin Update 2 :
INotifyObserver interface and TObserverSubject compile without any problem.
But Delphi cannot compile this
type
TMyClient = class(TInterfacedObject, INotifyObserver)
protected
procedure ObserverNotify(Sender: Integer);
end;
I'm getting E2065: Unsatisfied forward or external declaration: 'TMyclient.ObserverNotify'
Appears that compiler cannot handle the generic type ?
Any workaround ?
http://www.delphipraxis.net/1141754-post6.html
I've found an old exemple on Delphi Praxis website. Looks interresting, Uwe Raabe wrote it : http://www.delphipraxis.net/1141754-post6.html
I took this code and tried to compile it under Delphi Berlin Update 2 :
INotifyObserver
But Delphi cannot compile this
type
TMyClient = class(TInterfacedObject, INotifyObserver
protected
procedure ObserverNotify(Sender: Integer);
end;
I'm getting E2065: Unsatisfied forward or external declaration: 'TMyclient.ObserverNotify'
Appears that compiler cannot handle the generic type ?
Any workaround ?
http://www.delphipraxis.net/1141754-post6.html
The compiler error E2065 means you did not hit Ctrl+Shift+C to produce the method implementation. :p
ReplyDeleteP.S. Use Event from Spring4D. It's Observer pattern put into a data type ;)
humm... feeling stupid
ReplyDelete