DataSnap "Plain old Delphi objects" and nested objects

A new article on DataSnap in Delphi XE explains that DataSnap can now transfer TObject children between server and client, similar to Java Enterprise Edition POJO Concept ("Plain Old Java Objects").

Does this new function work if such a PODO has nested object type properties that need to be initialized, for example, the TStrings property? Will all these sub-objects be serialized and migrated with their current values? What about the properties of system resources, such as TFileStream, THandle, or TThread, which do not make sense in a serialized object, can they be marked as "not serializable"?


Some information is in the DocWiki , including the following:

These are fields for which conversion / reversion is already built-in: integer, string, char, enumeration, float, object, record. For the following types, field values ​​are ignored and the user is expected to convert: set, method, option, interface, pointer, dynArray, classRef, array.

+5
source share
1 answer

, , , , . , -, , .

type
  TAddress = record
    FStreet: String;
    FCity: String;
    FCode: String;
    FCountry: String;
    FDescription: TStringList;
  end;

  TPerson = class
  private
    FName: string;
    FHeight: integer;
    FAddress: TAddress;
    FSex: char;
    FRetired: boolean;
    FChildren: array of TPerson;
    FNumbers: set of 1..10;
  public
    constructor Create;
    destructor Destroy; override;

    procedure AddChild(kid: TPerson);
  end;
+4

All Articles