J
Jon Skeet [C# MVP]
Chad Z. Hower aka Kudzu said:Yes that would be a problem. The protocol methods are normaly endpoints and
are not called from internally, but many middle classes have methods that are
used by users.
Right.
Indy typically uses var (by ref) arguments when its not a simple type. But
there are a few instances of TStrings as a result IIRC. We could maybe map
them to ones that use by ref calls and keep the existing ones as well?
Eek - I hadn't realised Indy used a lot of pass-by-reference. I'm
personally pretty averse to it, and again, it's not "the normal .NET
way of doing things". Again, this is no criticism of Indy and its
history, just another barrier to adoption. It needn't be a fatal one,
but it is one nonetheless.
Delphi only supports thes in Delphi.net (AFAIK), not previous versions.
If it did - how would this help our situation though? And remember - these
are not just valued classes. They are actual classes with methods that Indy
uses, so Im not sure that this is workable either.
I think you were missing my point - or I'm missing yours. The extra
classes (TIdStringArray or TStrings, for instance - to be honest, I've
somewhat lost the plot as to what is what could still appear in the
interface, but wouldn't need to be seen at all in the .NET developer's
code. They could pass a string array, and a conversion could be
performed (in exactly the way you show in your examples) to convert to
the relevant type.
Users would still need to recognise TIdStringArray or TStrings or
whatever, and realise that they can treat it as a string[], but it
would be better than the conversions occurring in their own code - in
my view, anyway.