Delphi JSON library for XE2 available for object serialization [closed]

There appears to be a few JSON options for Delphi out there - is there a recommended library for use with XE2? I'm looking for sharing of objects between Delphi XE2 and PHP web applications. (serialization and posting delphi objects in a compatible way for PHP web apps and de-serialization from a restful PHP call to delphi server side)


Solution 1:

JSON support* is included in XE2 (and XE). JSON

See this thread in SO for a link to a paper by Marco, explaining use of JSON and restful implementations.

REST Servers in Delphi XE Using DataSnap

  • Note : This is valid for the Enterprise and up version.

Solution 2:

I know of two libraries.

The built in library and Super Object.

I use Super Object as it's really easy to use.

Solution 3:

DWScript has a dwsJSON unit which implements a fast JSON parser & writer, it doesn't rely on RTTI/TPersistent but on mapping by custom code.

Solution 4:

  • SuperObject
  • lkJSON

Unlike XML libraries (OmniXML, NativeXml) lkJSON does not provide methods to serialize TObject / TPersistent instances using RTTI directly, it requires custom code to map the property values to a JSON object.

SuperObject support marshaling for Delphi 2010 and higher.