On 21.03.2013 21:48, Hans-Peter Diettrich wrote:
Also the hype about CORBA interfaces looks like mere eye-candy or
obfuscation to me. Delphi interfaces require neither COM nor CORBA, they
are only open in either direction.

But some people don't like the reference counting. They want to use
interfaces like in other languages to just define a "interface" to a
class.

Since reference counting must be implemented, it also can be implemented
as *not* counting references. Similar to AnsiString constants, which
also live forever. A simple _AddRef after creation of an interfaced
object achieves almost the same effect.

But then you need to implement these methods. Here I like CORBA style interfaces very much: just add the interface to any class, implement the methods the interface defines and be done. The same way as it is done in e.g. Java and C#.

And CORBA style interfaces also provide a bit more protection against using the implementation of the interface as they don't allow "as/is ClassType" like the COM style interfaces (they still allow "as InterfaceType/StringConstant" though if the interface has a string constant as a "GUID").

Regards,
Sven

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to