Book Image

Delphi Cookbook

By : Daniele Teti
Book Image

Delphi Cookbook

By: Daniele Teti

Overview of this book

Table of Contents (14 chapters)
Delphi Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Serializing a dataset to JSON and back


At the time when almost all the Delphi program was client/server, or in general, when the Delphi program was always connected to the database server in a full-connected scenario, the datasets' serialization was a niche topic. There were really few situations where you really need this kind of functionality in the core of your application. Were the '90s!' Now, however, making your data available to other programs or getting data from other software running somewhere in the world is the normal. In some cases, the other "programs" are not written in Delphi, so the DataSet.SaveToFile method (or other serialization that use a proprietary or exotic format) is no longer enough. Let's say we've a JavaScript frontend for our Delphi application server. Your data should be "dedelphized" (I've just coined this word) and should be independent from the backend programming language or framework used. Delphi have a lot of serialization facilities, but there isn't a...