Recent

Author Topic: Good explaination of how interfaces work.  (Read 1837 times)

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: Good explaination of how interfaces work.
« Reply #15 on: October 02, 2022, 09:35:00 pm »
if you want multiple inheritance then Interfaces is just about the only path  i can think of here.

Not sure about the COBRA but I believe COM could be a little slow due to how it accesses its members which makes the system more universal for other languages to work with it.

 it all depends on how you need to code. In some cases, I find the use of interfaces are ok for multiple inheritance but that is just about it, otherwise the classic model is faster.

 
The only true wisdom is knowing you know nothing

Warfley

  • Hero Member
  • *****
  • Posts: 1499
Re: Good explaination of how interfaces work.
« Reply #16 on: October 02, 2022, 11:46:09 pm »
I wouldn't call it multiple inheritance, because when looking at other languages, this can be very confusing. In languages like C++ multi inheritance describes inheritance of multiple classes including functionality, there are no interfaces (i.e. only signatures no functionality). Other languages like Go don't have inheritance in the classical sense, but still has interfaces.
In the context of Pascal, you could call it multiple inheritance "lite" (as there is no functionality as is with class inheritance), but I would just call it what it is, just a description of the promised functionality of a class

cdbc

  • Hero Member
  • *****
  • Posts: 1026
    • http://www.cdbc.dk
Re: Good explaination of how interfaces work.
« Reply #17 on: October 03, 2022, 05:14:29 pm »
Hi
About CORBA interfaces, there's an excellent example on how to use them, in TPersistent. Have a look at how it handles implementing the observer pattern, namely IFPObserved and IFPObserver, respectively SGUIDObserved, SGUIDObserver. I find that solution simple and elegant  8-)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

AlanTheBeast

  • Sr. Member
  • ****
  • Posts: 348
  • My software never cras....
Re: Good explaination of how interfaces work.
« Reply #18 on: October 04, 2022, 04:56:49 pm »
I have looked and looked and

Am I the only one who sees someone having us do his homework for him?
Everyone talks about the weather but nobody does anything about it.
..Samuel Clemens.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Good explaination of how interfaces work.
« Reply #19 on: October 04, 2022, 05:09:50 pm »
I have looked and looked and

Am I the only one who sees someone having us do his homework for him?

Judging by the two pages of accrued comments between OP's request and your comment, yes.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: Good explaination of how interfaces work.
« Reply #20 on: October 04, 2022, 05:12:47 pm »
I have looked and looked and

Am I the only one who sees someone having us do his homework for him?

Yes. The OP was a spammer that probably copied this message from sb doing homework. The spam link has been removed and account can't do anything any more so that the  discussion was preserved.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Good explaination of how interfaces work.
« Reply #21 on: October 04, 2022, 05:27:31 pm »
Yes. The OP was a spammer that probably copied this message from sb doing homework. The spam link has been removed and account can't do anything any more so that the  discussion was preserved.

Thanks for the clarification- and for not deleting an interesting thread.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018