Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2016-10

CORBA interfaces: no IInterface and TInterfaceList support

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Why doesn't CORBA have the equivalent of IInterface?

I have to resort to creating something like this.

type
  IEmptyInterface = interface
  ['{C2196B92-8D96-11E6-A5D6-C86000E37EB0}']
  end;

and and then make sure all my CORBA interfaces descend from IEmptyInterface. The reason I need to do this is because I'm creating code that works purely with interfaces, but CORBA doesn't have a base type I can use as a parameter - which I think is just wrong or at least not optimal.

This brings me to the second point... No TInterfaceList for CORBA style interfaces either. I'm guessing the reason it doesn't exist is again down to the fact that there is no base type for CORBA interfaces. To work around this, I have to use a TFPList as casting. One glaring problem with using TFPList, is that it is NOT thread safe, whereas TInterfaceList is a thread safe list. So another thing I'll have to implement myself.

The RTL is all about convenience for the developer, but as it currently stands, CORBA interfaces don't seem to get much love from the RTL. Whereas if you use COM interfaces, there are plenty of useful things in the RTL.

Regards,
Graeme

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ My public PGP key: http://tinyurl.com/graeme-pgp

Reply by email

Sven Barth
to Graeme Geldenhuys

Am 09.10.2016 00:13 schrieb "Graeme Geldenhuys" <

Show quoted text 5 lines
: Hi, Why doesn't CORBA have the equivalent of IInterface?

Because that interface type doesn't need it, just like TP-style objects don't need it. IInterface (aka IUnknown) merely exists due to the reference counting needs.

Show quoted text 7 lines
This brings me to the second point... No TInterfaceList for CORBA style interfaces either. I'm guessing the reason it doesn't exist is again down to the fact that there is no base type for CORBA interfaces. To work around this, I have to use a TFPList as casting. One glaring problem with using TFPList, is that it is NOT thread safe, whereas TInterfaceList is a thread safe list. So another thing I'll have to implement myself.

You could always use generics, this way you'd need to write your class only once.

Regards,
Sven

Reply by email