Extend structure in structure/array/RoComplexType

Hi,

If your login string (like we use in Data Abstract) supports parameters like

user=user1;password=password1;extraparam=value;

better to pass client version in login string so server can recognize version of client.
by other hand, you can pass some info in HTTP headers. Indy HTTP client allows to pass extra data in HTTP headers.

Note: Check Receiving information about client on server-side snippet. it shows how to read HTTP headers on server-side.

Client version can be stored inside session.

Note: The Session Types sample (Delphi) shows how to read and store values inside session.

if you know what version client is used (old or new), you can use original struct or his descendant with extra fields as a members of your array depending on client version.

as a result,

  • old clients will receive original struct
  • new clients will receive descendant of original struct with extra fields.

in this case, you should change nothing - new client will read server response and create descendant with extra fields.

this way is more suitable for updates with breaking changes.


this way is suitable for one time changes


3rd way can be in combining above solutions: introduce a new login method that accepts client version.

this way is more suitable for updates with breaking changes and allows to pass client version to server in easy mode w/o using HTTP headers.