Interface types "namespacing" in Delphi?

Hello.

I’ve one actual problem.

I need to use more Interfaces (_Intf) in my client project, with same types.

For example, I have LibraryA_Intf and LibraryB_Intf included in my project.

And both of them declare my own “RTResponse” type, but it differs in both RODLs.

The problem is that both types are registered with the same class name in the Initialization section in both units by RegisterROClass.

They have same name, but GetClass doesn’t violate and registers both of them (but this is not the point).

When I need to invoke some service, the types are mish-mashed in runtime and doesn’t match with the current type definition (in terms of scope).

Is there some way to let co-exist more RO-Interfaces with some types with the same class name ?

Is there some solution to “namespace” types in the Initialization section ?

Thank you for your help.

I’m afraid there’s no way to support this, currently. RemObjects SDK uses a flat namespace for all types on the wire, as not all platforms supported by RO have namespace support. You will need to pick unique names.

OK, Roger Marc.

In such cases I used a 3rd RODL that defines RTResponse as base type.
The both other RODLs can inherit it’s customizes Response Types from the central RODL. Thats worked fine in my use cases.

I struggled today over the same problem. In my case I have to support 2 versions of an API provided by Salesforce.com (Enterprise_V29 and Enterprise_V33 WSDL)

The same object names with small differences exists within both versions. And they both have to exist in the same application. For the moment I have to dynamically RegisterROClass and UnRegisterROClass to work around that issue.
But this cannot be a final solution.

The problem is the fact that 2 identically named Classes exist.
lActualClass := FindROClass(clsnme);
returns the wrong one and fails in
if not lActualClass.InheritsFrom(aClass) then RaiseError…

Why not give FindROClass(clsname,aClass) … as a hint to the preferred class if more than object with that name exists?

I made some more tests and the whole is not that easy.

Switching to find an ROClass by QualifiedClassName (=[unitname]_[classname]) instead of ClassName does not work at all places. Why: At certain generic code areas the [unitname] not known.

But the problem remains that this is a major design problem. Really world use cases cannot be solved with the current implementation of RO SDK.

Why is it that complex to improve? Why not register the objects be referencing to the interface class name
procedure RegisterROClass(aComplexTypeClass : TROComplexTypeClass; aROInterfaceClassName: string);

regards Günther