Hi,
-
An enum value is essentially an Integer, that's why we are storing enum values as Integers. JSON is limited to numbers and strings as values so there is no alternative to store enums.
-
Sorting of properties cannot be manipulated. The sorting is determined by RTTI looping through properties.
-
Inheriting from TPersistent is optional, but assures you can publish properties which are mandatory to persist your object. You can inherit from TObject, and keep published properties, but then you'll experience a warning:
[dcc32 Warning] MyUnit.pas(11): W1055 PUBLISHED caused RTTI ($M+) to be added to type 'TMyObject'
For question 2 & 3. TTMSFNCJSONToClass is actually a helper that generates classes and properties based on JSON. What you are doing in the above code snippet is not related this functionality. It's a complete different new class we wrote to assist you in writing Delphi classes to import JSON. Since you already have your class, this functionality is not applicable.
For more info around JSON to object & object to JSON you can read this:
or a series of blog posts: