On Thu, Sep 21, 2017 at 5:00 AM, Michael Schnell via Lazarus <lazarus@lists.lazarus-ide.org> wrote: > On 20.09.2017 22:09, Marcos Douglas B. Santos via Lazarus wrote: >> >> In a perfect design, we may only connect all objects to work in a "task", >> call "run", and "they" will know what to do. They (Objects) will decide how >> to do. Not the programmer (the "controller"). Just objects sending messages >> for each other. > > Is that what the (language construct) "Interface" is supposed to provide ?
No. But Interfaces are very important. There is not true OOP without "contracts" — that is what Interfaces are. You can use inheritance to provide polimorphism, but inheritance could be evil and should be avoided[1] as much you can. Instead, use composion. Others languages are using "duck typing", but I believe Interfaces are better. Regards, Marcos Douglas [1] My posts about inheritance https://goo.gl/nzM4Ss -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus-ide.org https://lists.lazarus-ide.org/listinfo/lazarus