How to do it...

Perform the following steps:

  1. Create a new VCL Forms Application.
  2. Drop four TButton and a TMemo on the form. Organize the TButton in a single row as a sort of toolbar and align the TMemo to cover the remaining part of the form.
  1. Name the TButton components as follows:
    • btnObjToJSON
    • btnJSONtoObject
    • btnListToJSONArray
    • btnJSONArrayToList
  1. Add a new unit to the project, name it JSON.Serializer.pas, and fill it in with the following code:
unit JSON.Serialization;interfaceuses  REST.JSON, System.Generics.Collections, Data.DBXJSON, System.JSON;type  TJSONUtils = class(TJSON)  public    class function ObjectsToJSONArray<T: class, constructor>      (AList: TObjectList<T>): TJSONArray;    class function JSONArrayToObjects<T: class, constructor ...

Get Delphi Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.