Re: [fpc-pascal] implements

2017-09-02 Thread Sven Barth via fpc-pascal
Am 02.09.2017 10:38 schrieb "Ryan Joseph" : > > > > On Sep 2, 2017, at 3:27 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > > > > Please search the internet about Interfaces and probably Design Patterns too. Have ever heard the phrase: "Code to an Interface, not an Implementation".

Re: [fpc-pascal] implements

2017-09-02 Thread Graeme Geldenhuys
On 2017-09-02 09:38, Ryan Joseph wrote: It separates the code (which is nice) but then gives you an annoying extra step of typing hook.XXX for every method. I don't have that problem, and I use interfaces extensively. Like multi-threading, Interfaces are an advanced feature of the Object Pasca

Re: [fpc-pascal] implements

2017-09-02 Thread Ryan Joseph
> On Sep 2, 2017, at 3:27 PM, Graeme Geldenhuys > wrote: > > Please search the internet about Interfaces and probably Design Patterns too. > Have ever heard the phrase: "Code to an Interface, not an Implementation". > > Interfaces are so much more than simply "adding methods to a class". I u

Re: [fpc-pascal] implements

2017-09-02 Thread Graeme Geldenhuys
On 2017-09-02 08:44, Ryan Joseph wrote: but then what is the purpose of this? Please search the internet about Interfaces and probably Design Patterns too. Have ever heard the phrase: "Code to an Interface, not an Implementation". Interfaces are so much more than simply "adding methods to a

Re: [fpc-pascal] implements

2017-09-02 Thread Ryan Joseph
> On Sep 2, 2017, at 2:35 PM, Sven Barth via fpc-pascal > wrote: > > Because you must use the interface and not the class instance: > > === code begin === > > var > base: TBaseClass; > hook: IHook; > begin > base := TBaseClass.Create; > hook := base; > > hook.DoIt; // will call bas

Re: [fpc-pascal] implements

2017-09-02 Thread Sven Barth via fpc-pascal
Am 02.09.2017 06:34 schrieb "Ryan Joseph" : > > I think I asked this some years ago but I came across it again I just don’t get what the point of this is. There is an “implements” property but it seems like yet another half-baked feature from Delphi that wasn’t implemented completely or is broken.