Are there any videos / screens or other resources on how to use interfaces in Delphi?

Hi, are there any good videos or other resources on how to use interfaces in delphi?

I am after the basics and more advanced things.

+6
delphi
source share
3 answers

After you read the material on the Internet, you probably should study the code of other programmers to find out how (and why) they used the interfaces in real code.

For example, in the Subversion repository of dUnit SourceForge, you will find XPObserver.pas , which implements the Observer template for Delphi using interfaces. This code is very interesting, since usually in this sample the observed objects store a list of observers, and each observer keeps a link to the objects (objects) that they observe. A naive implementation using interfaces would create circular references, interfaces would allow their reference counts to reach 0, and this would lead to memory leaks. The code in XPObserver.pas shows how you can use typecasting to solve this problem.

IMO, most XP * .pas files deserve close attention. For example, XPInterfacedObject.pas provides an explanation of why aggregated interfaces should use a common reference counter and present an alternative solution for TAggregatedObject and TContainedObject as implemented in VCL.

+7
source share

Not a video, but it explains the basics.

+5
source share

Because COM uses interfaces, this online course is also an introduction to interfaces.

+2
source share

All Articles