Our services(Delphi) communicate with clients(.Net and Delphi) and exchange
data structs defined in Service Builder.
Need to add nullable support for simple types(Integer, Double…) in RO data structs.
I know that currently this functionality is missing and I have to emulate this via
RODLStruct(ROComplexType).
I’m looking for ideas, because my implementations have disadvantages:
-
Solution A
<Struct Name=“NullableInteger” …>
Delphi:
Convenient to use NullableInteger due to ProductData.AutoCreateParams=“1”.
function ProductData.GetId: NullableInteger;
begin
if (fId = nil) then fId := NullableInteger.Create();
Result := fId;
end;
.Net:
Inconvenient to use due to the bug.
More details:
http://talk.remobjects.com/t/c-codegen-ignores-rodlstruct-autocreateparams-1-for-nested-structs/7646
-
Solution B
<Struct Name=“NullableInteger” …>
Inconvenient to use due to Service Builder has very limited configuration for AutoCreateParams.
More details:
http://talk.remobjects.com/t/how-to-disable-rodlstruct-autocreateparams/7678
- Solution C
Use Variant data type for nullable simple types.
Disadvantage: no type safety.
Regards
Delphi XE5, RemObjects SDK for Delphi and all Clients 8.3.93.1183