On Fri, Oct 6, 2017 at 1:06 PM, Michalis Kamburelis <michalis.ka...@gmail.com> wrote: > > 05.10.2017 2:07 PM "Marcos Douglas B. Santos" <m...@delfire.net> napisał(a): > > [...] > As Sven told you, just use COM Interfaces. > Look this explanation -> > http://castle-engine.io/modern_pascal_introduction.html#_corba_and_com_types_of_interfaces > but don't pay attention when to author says "Ugly (COM) interfaces" > because it is not. :) > > Really, it is not. > > > I hope I explained there why I consider the COM design "ugly": because it > puts three often-unrelated features (reference counting, and ability for > multiple classes to expose same API safely, and interaction with COM > technology) in one bag.
I think you did, but I believe that we can forget the interaction with COM even that feature was made to work with COM. IMO, more important is the reference counting. > In this case, in which you indeed want two of these features simultaneously, > I advise COM interfaces myself :) That's why they are documented after all. I can use it only to use reference counting. > In general, I would prefer these features to be available separately. Like > other languages do: interfaces in Java and C# are only to "expose same API > from multiple classes" (granted, comparison is unjust as Java and C# just > have garbage collection) -- in Pascal you get this by CORBA interfaces. It would be better if these features were available separately, I agree. About the gargabe collection, we can use the referece counting for the same purpose — of course you know this, but maybe we have different opinions about how to use this feature. I would agree that "CORBA" interfaces is more pascalish than "COM" interfaces, but I am sure that reference counting is a good feature to improve the code design. > And reference counting like in e.g. C++ "shared pointers", that can wrap any > class, without any additional feature (in Pascal we may get this with > "management operators"). I don't know about "management operators". Could you explain more about them? Best regards, Marcos Douglas _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal