Skip to content

Interfaces2 - GUI

By reading the introduction of the interfaces, you obtained a mechanism that makes a class really and completely abstract.

From the article we highlighted their total abstraction.
We noticed that it's contained methods must be overridden by the inherited class(es).
Furthermore a interface does not have any attributes.

Finally we wrote - just on the rush - that the Interfaces mechanism overpasses one compiler's weak point, about the inability to support the multiple inheritance.

In brief: the multiple inheritance in FreePascal grants that an inheriting class can inherits from more than one more abstract class.
It so expands its possibility to enrich itself, always  by keeping the order and the hierarchy achieved with the interfaces.

And that's very good... in theory.

...continue reading "Interfaces and multiple inheritance"

Interface - GUI

We've finished the previous article on inheritance talking about the way used in FreePascal (and in Delphi too) to make a class abstract; we've learned that by declaring just one method as virtual abstract is enough to get the result.

But again we've seen that is not true, indeed.
Theory says one thing, and reality another one! This is a rule you should always keep in mind, because reality always doesn't care of your thoughts. 😉

Back to our example... is there a way to get a true abstract class? Luckily yes!

Ladies and Gentlemen, here the interfaces!

...continue reading "Interfaces. An introduction"