The PokéCommunity Forums Off-Topic Discussions Science & Technology
The Coder's Lounge

Science & Technology From the computer lab to the chemistry lab, or even the observatory, here's where we nerd out over all things science and technology!

Thread Tools
Old 13 Hours Ago (4:27 AM).
Marth's Avatar
Marth Marth is offline
Join Date: Feb 2013
Gender: Male
Posts: 2,581
The way how Delphi handles interfaces has got to be the weirdest and stupidest way that I've ever seen.

Basically, when you want to implement an interface, you automatically subscribe to implement three specific methods as well, whose only purpose is to keep track of the weird reference counting those interfaces do. From what I understand that's also the reason why in Delphi you can specify multiple interfaces alongside a class the implementing class inherits from. Delphi by itself is only single-inheritance.

Looking at different tutorials, the way people get around that issue is deriving the class from a class called TInterfacedObject whose only purpose is to implement those three methods. However, if you do that, since Delphi is only single inheritance, you lose out on the ability to derive from another class. So, if you don't want that you end up copying them anyway.

Reply With Quote

Relevant Advertising!


Quick Reply

Join the conversation!

Create an account to post a reply in this thread, participate in other discussions, and more!

Create a PokéCommunity Account

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -8. The time now is 6:03 PM.