Serializing Objects with TJson

Serializing objects to Json as well as de-serializing them with the Delphi standard libraries has been subject to many discussions. While the majority suggests to use another library or a self implemented solution, there are others who would prefer the built-in tools for a couple of reasons. Simplicity and the availability with every (decent) Delphi installation being the most mentioned ones.

The ease and elegance of a TRESTRequest.AddBody<T>(myInstance) call is hard to attain with other means. I guess it is not myself alone being tempted to make use of it. With a bit of care taken when designing the objects to serialize the results are often quite satisfying and fit the requirements. Nourishing this with some advanced techniques shown in this post may be enough to keep the benefits without the need for external code. Continue reading “Serializing Objects with TJson”